Changeset 43
- Timestamp:
- 01/16/06 23:41:50 (3 years ago)
- Files:
-
- trunk/lib/jelix/core/jErrorHandler.lib.php (modified) (2 diffs)
- trunk/lib/jelix/core/jException.lib.php (modified) (3 diffs)
- trunk/lib/jelix/core/response/jResponseHtml.class.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseJsonrpc.class.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseText.class.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseXmlrpc.class.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseXul.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/core/jErrorHandler.lib.php
r23 r43 70 70 // traitement du message 71 71 if(strpos($action , 'ECHO') !== false){ 72 73 72 if($gJCoord->response == null){ 74 73 $gJCoord->initDefaultResponseOfRequest(); 75 74 } 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); 79 76 } 80 77 if(strpos($action , 'LOGFILE') !== false){ … … 89 86 90 87 if(strpos($action , 'EXIT') !== false){ 88 $gJCoord->response->outputErrors(); 91 89 exit; 92 90 } trunk/lib/jelix/core/jException.lib.php
r23 r43 21 21 } 22 22 23 $conf = $gJConfig->error Handling;23 $conf = $gJConfig->error_handling; 24 24 $action = $conf['exception']; 25 25 … … 32 32 '%line%' => $exception->getLine() 33 33 )); 34 if($gJCoord->response == null){ 35 $gJCoord->initDefaultResponseOfRequest(); 36 } 34 37 35 38 // traitement du message 36 39 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()); 48 41 } 49 42 if(strpos($action , 'LOGFILE') !== false){ … … 57 50 } 58 51 59 if(strpos($action , 'EXIT') !== false){ 60 exit; 61 } 52 $gJCoord->response->outputErrors(); 62 53 } 63 54 trunk/lib/jelix/core/response/jResponseHtml.class.php
r28 r43 161 161 echo '<html><head><title>Errors</title></head><body>'; 162 162 } 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 } 164 168 echo '</body></html>'; 165 169 } trunk/lib/jelix/core/response/jResponseJsonrpc.class.php
r23 r43 56 56 public function outputErrors(){ 57 57 global $gJCoord; 58 if($this->errorCode == 0 && $this->errorMessage == ''){ 59 $this->errorMessage = 'Unknow error'; 60 $this->errorCode = -1; 61 } 58 62 header("Content-Type: text/plain"); 59 63 $content = jJsonRpc::encodeFaultResponse($this->errorCode,$this->errorMessage, $gJCoord->request->params['id']); trunk/lib/jelix/core/response/jResponseText.class.php
r23 r43 53 53 global $gJConfig; 54 54 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 } 56 60 } 57 61 trunk/lib/jelix/core/response/jResponseXmlrpc.class.php
r23 r43 45 45 46 46 public function outputErrors(){ 47 if($this->errorCode == 0 && $this->errorMessage == ''){ 48 $this->errorMessage = 'Unknow error'; 49 $this->errorCode = -1; 50 } 51 47 52 header("Content-Type: text/xml;charset=".$GLOBALS['gJConfig']->defaultCharset); 48 53 $content = jXmlRpc::encodeFaultResponse($this->errorCode,$this->errorMessage, $GLOBALS['gJConfig']->defaultCharset); trunk/lib/jelix/core/response/jResponseXul.class.php
r23 r43 116 116 } 117 117 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 } 119 123 echo '</vbox></',$this->_root,'>'; 120 124 }
