Lsrur\Inspector\Collectors\ExceptionCollector::handleException PHP Method

handleException() public method

public handleException ( $exception, $caught = false )
    public function handleException($exception, $caught = false)
    {
        if (!app('Inspector')->isOn()) {
            return;
        }
        $files = [['file' => $exception->getFile(), 'line' => $exception->getLine()]];
        foreach ($exception->getTrace() as $item) {
            if (isset($item['file']) && str_is(app_path() . '*', $item['file'])) {
                $files[] = ['file' => $item['file'], 'line' => $item['line']];
            }
        }
        $files = $this->getSourceCode(collect($files)->unique('file')->toArray());
        $this->exceptions[] = ['message' => $exception->getMessage(), 'code' => $exception->getCode(), 'trace' => $exception->getTrace(), 'class' => get_class($exception), 'files' => $files, 'caught' => $caught];
        //   dd($collectorClass, $methodName);
        //   && config('inspector.exception_render', false)
        if (!$caught) {
            $status = in_array('getStatusCode', get_class_methods(get_class($exception))) ? $exception->getStatusCode() : 500;
            app('Inspector')->dd($status);
        }
    }