Merge pull request #405 from shakhraj/inspector-in-data-table-callback

Pass Inspector into data table callbacks
This commit is contained in:
Denis Sokolov
2016-09-04 17:49:05 +03:00
committed by GitHub
3 changed files with 35 additions and 5 deletions
+11
View File
@@ -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