Commit 595f8c47377d219d225fe226a41cf09c76fe4f9e

Authored by Marcelo Linhares Castro
1 parent db14a60b
Exists in master

Catch de erro em recuperacao de sistemas operacionais e tambem na leitura do dir…

…etorio de dados do sei. A pedido da UFC
Showing 1 changed file with 15 additions and 3 deletions   Show diff stats
rn/MdEstatisticasColetarRN.php
... ... @@ -144,8 +144,16 @@ class MdEstatisticasColetarRN extends InfraRN
144 144 $bytestotal = 0;
145 145 $path = realpath($path);
146 146 if ($path !== false) {
147   - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object) {
148   - $bytestotal += $object->getSize();
  147 + try{
  148 + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object) {
  149 + try{
  150 + $bytestotal += $object->getSize();
  151 + }catch(Exception $e1){
  152 + $bytestotal += 0;
  153 + }
  154 + }
  155 + }catch(Exception $e2){
  156 + $bytestotal = 0;
149 157 }
150 158 }
151 159 return $bytestotal;
... ... @@ -480,7 +488,11 @@ class MdEstatisticasColetarRN extends InfraRN
480 488 } else {
481 489 $query = "select distinct user_agent as nome from infra_auditoria where user_agent is not null";
482 490 }
483   - $sistemas = BancoSEI::getInstance()->consultarSql($query);
  491 + try{
  492 + $sistemas = BancoSEI::getInstance()->consultarSql($query);
  493 + } catch (Exception $e) {
  494 + $sistemas = array(array('nome'=>'(XX)'));
  495 + }
484 496  
485 497 $lista = array();
486 498 foreach ($sistemas as $r) {
... ...