diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 96a2b394..f0c6050a 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -314,6 +314,15 @@ class LeftAndMain extends Controller { SSViewer::set_theme(null); } + public function handleRequest(SS_HTTPRequest $request) { + try { + return parent::handleRequest($request); + } catch(ValidationException $e) { + // Nicer presentation of model-level validation errors + return $this->httpError(403, $e->getResult()->message()); + } + } + /** * If this is set to true, the "switchView" context in the