src/Http/Responses/Responses.php
public function exception(\Exception $ex)
    {
        /** If the current codec cannot encode JSON API, we need to reset it. */
        if ($this->getCodec()->willNotEncode()) {
            $this->codec = $this->api->getDefaultCodec();
        }

        return $this->getErrorResponse(
            $this->exceptions->parse($ex)
        );
    }
public function exception(\Exception $ex)
    {
        /** If the current codec cannot encode JSON API, we need to reset it. */
        if ($this->getCodec()->willNotEncode()) {
            $this->codec = $this->api->getDefaultCodec();
        }

        return $this->getErrorResponse(
            $this->exceptions->parse($ex)
        );
    }
Render an exception that has arisen from the exception handler.

@param \Exception $ex
@return mixed