From: Tim Düsterhus Date: Thu, 13 Apr 2023 14:22:36 +0000 (+0200) Subject: Stop wrapping selected exceptions into an AJAXException X-Git-Tag: 6.0.0_Alpha_1~260^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a9007c75771db06198f7308f7e962e4ddd04afd;p=GitHub%2FWoltLab%2FWCF.git Stop wrapping selected exceptions into an AJAXException These exceptions are converted into clean responses using the HandleExceptions middleware. --- diff --git a/wcfsetup/install/files/lib/action/TAJAXException.class.php b/wcfsetup/install/files/lib/action/TAJAXException.class.php index 8ea381e979..edefd92ce4 100644 --- a/wcfsetup/install/files/lib/action/TAJAXException.class.php +++ b/wcfsetup/install/files/lib/action/TAJAXException.class.php @@ -33,35 +33,11 @@ trait TAJAXException protected function throwException($e) { if ($e instanceof InvalidSecurityTokenException) { - throw new AJAXException( - WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.sessionExpired'), - AJAXException::SESSION_EXPIRED, - $e->getTraceAsString(), - [ - 'file' => $e->getFile(), - 'line' => $e->getLine(), - ] - ); + throw $e; } elseif ($e instanceof PermissionDeniedException) { - throw new AJAXException( - WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), - AJAXException::INSUFFICIENT_PERMISSIONS, - $e->getTraceAsString(), - [ - 'file' => $e->getFile(), - 'line' => $e->getLine(), - ] - ); + throw $e; } elseif ($e instanceof IllegalLinkException) { - throw new AJAXException( - WCF::getLanguage()->get('wcf.ajax.error.illegalLink'), - AJAXException::ILLEGAL_LINK, - $e->getTraceAsString(), - [ - 'file' => $e->getFile(), - 'line' => $e->getLine(), - ] - ); + throw $e; } elseif ($e instanceof UserInputException) { // repackage as ValidationActionException $exception = new ValidateActionException($e->getField(), $e->getType(), $e->getVariables());