added default error messages to errorResponse and badRequest

This commit is contained in:
Jonathan Labreuille
2016-08-03 14:08:22 +02:00
parent 28c39d301c
commit 6675d5a20d
4 changed files with 13 additions and 9 deletions

View File

@ -60,13 +60,7 @@ define('ajax', ['mailpoet', 'jquery', 'underscore'], function(MailPoet, jQuery,
).then(function(data) {
return data;
}, function(xhr) {
if (!xhr.responseJSON) {
return {
errors: [{ error: 'undefined', message: "An unknown error occurred." }]
};
} else {
return xhr.responseJSON;
}
return xhr.responseJSON;
});
// clear options