public function handleDevelopmentError(SystemEvent $systemEvent, $exception)
    {
        $details = [];

        $e = $exception;
        while ($e) {
            $item = [
                'class'   => get_class($exception),
                'message' => $exception->getMessage(),
                'file'    => $exception->getFile(),
                'line'    => $exception->getLine(),
                'trace'   => $exception->getTraceAsString(),
            ];

            $details[] = $item;
            $e         = $e->getPrevious();
        }
        $result = json_encode(['details' => $details]);
        $body   = Stream::make($result);

        $status = 503;

        if ($exception instanceof ExceptionInterface && $exception->getCode()) {
            $status = $exception->getCode();
        }
        $response = new Response($status, $body, ['Content-Type' => 'application/problem+json']);
        $this->processResponse($response, $systemEvent);
    }