Fixed ValidationException handling in LeftAndMain

getResult() isn't always available, and has the same content
as the native Exception->getMessage() anyway
This commit is contained in:
Ingo Schommer 2013-03-19 14:02:28 +01:00
parent 99ca0471f7
commit 52ffb307a7

View File

@ -359,7 +359,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
} catch(ValidationException $e) {
// Nicer presentation of model-level validation errors
$msgs = _t('LeftAndMain.ValidationError', 'Validation error') . ': '
. $e->getResult()->message();
. $e->getMessage();
$e = new SS_HTTPResponse_Exception($msgs, 403);
$e->getResponse()->addHeader('Content-Type', 'text/plain');
$e->getResponse()->addHeader('X-Status', rawurlencode($msgs));