mirror of
https://github.com/filp/whoops.git
synced 2026-10-09 05:26:00 +00:00
Merge pull request #405 from shakhraj/inspector-in-data-table-callback
Pass Inspector into data table callbacks
This commit is contained in:
@@ -36,6 +36,17 @@ $handler->addDataTable('Ice-cream I like', [
|
||||
'Vanilla' => 'ew',
|
||||
]);
|
||||
|
||||
$handler->addDataTableCallback('Details', function(\Whoops\Exception\Inspector $inspector) {
|
||||
$data = array();
|
||||
$exception = $inspector->getException();
|
||||
if ($exception instanceof SomeSpecificException) {
|
||||
$data['Important exception data'] = $exception->getSomeSpecificData();
|
||||
}
|
||||
$data['Exception class'] = get_class($exception);
|
||||
$data['Exception code'] = $exception->getCode();
|
||||
return $data;
|
||||
});
|
||||
|
||||
$run->pushHandler($handler);
|
||||
|
||||
// Example: tag all frames inside a function with their function name
|
||||
|
||||
Reference in New Issue
Block a user