mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
99ca0471f7
commit
52ffb307a7
@ -359,7 +359,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
} catch(ValidationException $e) {
|
} catch(ValidationException $e) {
|
||||||
// Nicer presentation of model-level validation errors
|
// Nicer presentation of model-level validation errors
|
||||||
$msgs = _t('LeftAndMain.ValidationError', 'Validation error') . ': '
|
$msgs = _t('LeftAndMain.ValidationError', 'Validation error') . ': '
|
||||||
. $e->getResult()->message();
|
. $e->getMessage();
|
||||||
$e = new SS_HTTPResponse_Exception($msgs, 403);
|
$e = new SS_HTTPResponse_Exception($msgs, 403);
|
||||||
$e->getResponse()->addHeader('Content-Type', 'text/plain');
|
$e->getResponse()->addHeader('Content-Type', 'text/plain');
|
||||||
$e->getResponse()->addHeader('X-Status', rawurlencode($msgs));
|
$e->getResponse()->addHeader('X-Status', rawurlencode($msgs));
|
||||||
|
Loading…
Reference in New Issue
Block a user