Changeset 43

Show
Ignore:
Timestamp:
01/16/06 23:41:50 (3 years ago)
Author:
laurentj
Message:

correction bug sur exception où aucune erreur ne s'affichait

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core/jErrorHandler.lib.php

    r23 r43  
    7070    // traitement du message 
    7171    if(strpos($action , 'ECHO') !== false){ 
    72  
    7372        if($gJCoord->response == null){ 
    7473            $gJCoord->initDefaultResponseOfRequest(); 
    7574        } 
    76         if($gJCoord->response->addErrorMsg($codeString[$errno], $code, $errmsg, $filename, $linenum) || strpos($action , 'EXIT') !== false){ 
    77             $gJCoord->response->outputErrors(); 
    78         } 
     75        $gJCoord->response->addErrorMsg($codeString[$errno], $code, $errmsg, $filename, $linenum); 
    7976    } 
    8077    if(strpos($action , 'LOGFILE') !== false){ 
     
    8986 
    9087    if(strpos($action , 'EXIT') !== false){ 
     88        $gJCoord->response->outputErrors(); 
    9189        exit; 
    9290    } 
  • trunk/lib/jelix/core/jException.lib.php

    r23 r43  
    2121    } 
    2222 
    23     $conf = $gJConfig->errorHandling; 
     23    $conf = $gJConfig->error_handling; 
    2424    $action = $conf['exception']; 
    2525 
     
    3232        '%line%' => $exception->getLine() 
    3333    )); 
     34    if($gJCoord->response == null){ 
     35      $gJCoord->initDefaultResponseOfRequest(); 
     36    } 
    3437 
    3538    // traitement du message 
    3639    if(strpos($action , 'ECHO') !== false){ 
    37  
    38         /*if($action & ERR_ACT_EXIT) 
    39             header("HTTP/1.1 500 Internal jelix error");*/ 
    40  
    41         if($gJCoord->response == null){ 
    42             $gJCoord->initDefaultResponseOfRequest(); 
    43         } 
    44  
    45         if($gJCoord->response->addErrorMsg('error', $exception->getCode(), $msg, $exception->getFile(), $exception->getLine()) || strpos($action , 'EXIT') !== false){ 
    46             $gJCoord->response->outputErrors(); 
    47         } 
     40      $gJCoord->response->addErrorMsg('error', $exception->getCode(), $msg, $exception->getFile(), $exception->getLine()); 
    4841    } 
    4942    if(strpos($action , 'LOGFILE') !== false){ 
     
    5750    } 
    5851 
    59     if(strpos($action , 'EXIT') !== false){ 
    60         exit; 
    61     } 
     52    $gJCoord->response->outputErrors(); 
    6253} 
    6354 
  • trunk/lib/jelix/core/response/jResponseHtml.class.php

    r28 r43  
    161161            echo '<html><head><title>Errors</title></head><body>'; 
    162162        } 
    163         echo implode("\n",$this->_errorMessages); 
     163        if(count($this->_errorMessages)){ 
     164            echo implode("\n",$this->_errorMessages); 
     165        }else{ 
     166            echo '<p style="color:#FF0000">Unknow Error</p>'; 
     167        } 
    164168        echo '</body></html>'; 
    165169    } 
  • trunk/lib/jelix/core/response/jResponseJsonrpc.class.php

    r23 r43  
    5656    public function outputErrors(){ 
    5757        global $gJCoord; 
     58        if($this->errorCode == 0 && $this->errorMessage == ''){ 
     59            $this->errorMessage = 'Unknow error'; 
     60            $this->errorCode = -1; 
     61        } 
    5862        header("Content-Type: text/plain"); 
    5963        $content = jJsonRpc::encodeFaultResponse($this->errorCode,$this->errorMessage, $gJCoord->request->params['id']); 
  • trunk/lib/jelix/core/response/jResponseText.class.php

    r23 r43  
    5353        global $gJConfig; 
    5454        header('Content-Type: text/plain;charset='.$gJConfig->defaultCharset); 
    55         echo implode("\n",$this->_errorMessages); 
     55        if(count($this->_errorMessages)){ 
     56            echo implode("\n",$this->_errorMessages); 
     57        }else{ 
     58            echo 'unknow error'; 
     59        } 
    5660    } 
    5761 
  • trunk/lib/jelix/core/response/jResponseXmlrpc.class.php

    r23 r43  
    4545 
    4646    public function outputErrors(){ 
     47        if($this->errorCode == 0 && $this->errorMessage == ''){ 
     48            $this->errorMessage = 'Unknow error'; 
     49            $this->errorCode = -1; 
     50        } 
     51 
    4752        header("Content-Type: text/xml;charset=".$GLOBALS['gJConfig']->defaultCharset); 
    4853        $content = jXmlRpc::encodeFaultResponse($this->errorCode,$this->errorMessage, $GLOBALS['gJConfig']->defaultCharset); 
  • trunk/lib/jelix/core/response/jResponseXul.class.php

    r23 r43  
    116116        } 
    117117        echo '<vbox>'; 
    118         echo implode("\n",$this->_errorMessages); 
     118        if(count($this->_errorMessages)){ 
     119           echo implode("\n",$this->_errorMessages); 
     120        }else{ 
     121           echo "<description style=\"color:#FF0000;\">Unknow error</description>"; 
     122        } 
    119123        echo '</vbox></',$this->_root,'>'; 
    120124    } 
Download in other formats: Unified Diff Zip Archive