public function format($ex)
    {
        $this->inspector = new Inspector($ex);

        if ($ex instanceof ErrorException) {
            $type = $this->determineSeverityTextValue($ex->getSeverity());
        } else {
            $type = ($ex instanceof Exception ? 'Uncaught ' : '') . $this->inspector->getExceptionName();
        }

        return $this->render((object) [
            'file'              => $ex->getFile(),
            'frames'            => $this->inspector->getFrames(),
            'hasFrames'         => $this->inspector->hasFrames(),
            'line'              => $ex->getLine(),
            'message'           => $ex->getMessage(),
            'previousException' => $this->inspector->getPreviousExceptionInspector(),
            'type'              => $type
        ]);
    }