mirror of
https://github.com/filp/whoops.git
synced 2026-08-17 11:12:51 +00:00
Pass Inspector into data table callbacks
This commit is contained in:
@@ -36,6 +36,17 @@ $handler->addDataTable('Ice-cream I like', array(
|
||||
'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