Expands the error handling capabilities for __all__ errors

This commit is contained in:
Jared Tabor 2018-08-06 11:55:59 -07:00
parent d7a9d76d25
commit b9e95b1158
No known key found for this signature in database
GPG Key ID: CC50E67C506270C9

View File

@ -114,6 +114,12 @@ function AtFormController (eventService, strings) {
if (typeof err.data === 'object') {
message = JSON.stringify(err.data);
} if (_.has(err, 'data.__all__')) {
if (typeof err.data.__all__ === 'object' && Array.isArray(err.data.__all__)) {
message = JSON.stringify(err.data.__all__[0]);
} else {
message = JSON.stringify(err.data.__all__);
}
} else {
message = err.data;
}