Page MenuHomePhabricator

D13150.diff
No OneTemporary

D13150.diff

diff --git a/src/error/phlog.php b/src/error/phlog.php
--- a/src/error/phlog.php
+++ b/src/error/phlog.php
@@ -20,12 +20,20 @@
);
foreach (func_get_args() as $event) {
- PhutilErrorHandler::dispatchErrorMessage(
- $event instanceof Exception
- ? PhutilErrorHandler::EXCEPTION
- : PhutilErrorHandler::PHLOG,
- $event,
- $metadata);
+ $data = $metadata;
+ if ($event instanceof Exception) {
+ $type = PhutilErrorHandler::EXCEPTION;
+ // If this is an exception, proxy it and generate a composite trace which
+ // shows both where the phlog() was called and where the exception was
+ // originally thrown from.
+ $proxy = new PhutilProxyException('', $event);
+ $trace = PhutilErrorHandler::getExceptionTrace($proxy);
+ $data['trace'] = $trace;
+ } else {
+ $type = PhutilErrorHandler::PHLOG;
+ }
+
+ PhutilErrorHandler::dispatchErrorMessage($type, $event, $data);
}
return $value;

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 10:45 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7708913
Default Alt Text
D13150.diff (983 B)

Event Timeline