src/Base/ExceptionHandler.php
public function throwToUser($exception, $asJson = false)
    {
        $httpCode = method_exists($exception, 'getHttpCode') ? call_user_func([$exception, 'getHttpCode']) : 500;
        $full = $this->envType !== StaticApplicationInterface::APP_ENV_PROD;
        if ($asJson) {
            $exceptionData = $this->getExceptionData($exception, $full, false);
        } else {
            $exceptionData = $this->renderException($exception, $full);
        }
        return $this->getResponse($httpCode, [], $exceptionData);
    }
public function throwToUser($exception, $asJson = false)
    {
        $httpCode = method_exists($exception, 'getHttpCode') ? call_user_func([$exception, 'getHttpCode']) : 500;
        $full = $this->envType !== StaticApplicationInterface::APP_ENV_PROD;
        if ($asJson) {
            $exceptionData = $this->getExceptionData($exception, $full, false);
        } else {
            $exceptionData = $this->renderException($exception, $full);
        }
        return $this->getResponse($httpCode, [], $exceptionData);
    }
Throw error description to user (browser)
@param \Throwable $exception
@param bool       $asJson
@return Response