Пример #1
0
 /**
  * Handle uncaught exceptions
  *
  * @param s $exception
  * @return void
  */
 public function handle_exception($exception)
 {
     // Build tracelist
     $trace = $exception->getTrace();
     foreach ($trace as $key => $stackPoint) {
         // I'm converting arguments to their type
         // (prevents passwords from ever getting logged as anything other than 'string')
         $trace[$key]['args'] = array_map('gettype', $trace[$key]['args']);
     }
     $result = array();
     foreach ($trace as $key => $stackPoint) {
         $result[] = sprintf($traceline, $key, $stackPoint['file'], $stackPoint['line'], $stackPoint['function'], implode(', ', $stackPoint['args']));
     }
     print_r($result);
     $data['%message%'] = $exception->getMessage();
     $data['%file%'] = $exception->getFile();
     $data['%line%'] = $exception->getLine();
     $data['%type%'] = 'Exception';
     $line = $this->prepare_line($data);
     $this->send($line);
 }