diff --git a/code/Controllers/ErrorPageControllerExtension.php b/code/Controllers/ErrorPageControllerExtension.php index 2f5fce7f..26715d82 100644 --- a/code/Controllers/ErrorPageControllerExtension.php +++ b/code/Controllers/ErrorPageControllerExtension.php @@ -24,6 +24,9 @@ class ErrorPageControllerExtension extends Extension { * @throws SS_HTTPResponse_Exception */ public function onBeforeHTTPError($statusCode, $request) { + if (\Director::is_ajax()) { + return; + } $response = ErrorPage::response_for($statusCode); if($response) { throw new SS_HTTPResponse_Exception($response, $statusCode);