Changeset 6518
- Timestamp:
- 12/16/07 08:26:27 (1 year ago)
- Files:
-
- trunk/lib/exception/sfException.class.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/exception/sfException.class.php
r6514 r6518 61 61 try 62 62 { 63 $this->outputStackTrace(); 63 $exception = is_null($this->wrappedException) ? $this : $this->wrappedException; 64 $this->outputStackTrace($exception); 64 65 } 65 66 catch (Exception $e) … … 76 77 * Gets the stack trace for this exception. 77 78 */ 78 protected function outputStackTrace() 79 { 80 $exception = is_null($this->wrappedException) ? $this : $this->wrappedException; 79 static protected function outputStackTrace($exception) 80 { 81 // log all exceptions in php log 82 error_log($exception->getMessage()); 81 83 82 84 if (class_exists('sfContext', false) && sfContext::hasInstance()) … … 86 88 if (sfConfig::get('sf_logging_enabled')) 87 89 { 88 $dispatcher->notify(new sfEvent($ this, 'application.log', array($this->getMessage(), 'priority' => sfLogger::ERR)));89 } 90 91 $event = $dispatcher->notifyUntil(new sfEvent($ this, 'application.throw_exception', array('exception' => $exception)));90 $dispatcher->notify(new sfEvent($exception, 'application.log', array($exception->getMessage(), 'priority' => sfLogger::ERR))); 91 } 92 93 $event = $dispatcher->notifyUntil(new sfEvent($exception, 'application.throw_exception')); 92 94 if ($event->isProcessed()) 93 95 { … … 106 108 } 107 109 108 $message = null !== $ this->getMessage() ? $this->getMessage() : 'n/a';109 $name = get_class($ this);110 $message = null !== $exception->getMessage() ? $exception->getMessage() : 'n/a'; 111 $name = get_class($exception); 110 112 $format = 0 == strncasecmp(PHP_SAPI, 'cli', 3) ? 'plain' : 'html'; 111 113 $traces = self::getTraces($exception, $format);