예제 #1
0
파일: exception.php 프로젝트: Kheros/MMOver
 /**
  * Creates a string representation of the error.
  * This is useful when logging or mailing the error and displays full details
  * of the error and where it occurred, including a full stack trace.
  *
  * @param bool $verbose					- Whether to display full details
  * @return string
  */
 public function toString($verbose = false)
 {
     // Build string
     $str = $this->message . "\r\n";
     // Add details
     if ($verbose) {
         $str .= "********************\r\n";
         $str .= 'Occured in file: ' . $this->file . " on line {$this->line}\r\n";
         $str .= 'Current Route: ' . vB_Router::getCurrentRoute() . "\r\n";
         $str .= 'Initial Route: ' . vB_Router::getInitialRoute() . "\r\n";
         $str .= 'Time: ' . date('l dS \\of F Y h:i:s A') . "\r\n";
         $str .= "Stack Trace:\n" . $this->getTraceAsString() . "\r\n";
     }
     return $str;
 }