mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
Error notification if send mail api returns 500
closes #3728 - If the mail config is broken, the ajax call will fail with 500 and not return an error. - This change catches 500 and wraps the error in a notification.
This commit is contained in:
parent
2b1beee7da
commit
4cd78e3e4d
@ -50,9 +50,13 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
|
|||||||
ic.ajax.request(this.get('ghostPaths.url').api('mail', 'test'), {
|
ic.ajax.request(this.get('ghostPaths.url').api('mail', 'test'), {
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
self.notifications.showSuccess('Check your email for the test message:');
|
self.notifications.showSuccess('Check your email for the test message.');
|
||||||
}).catch(function (response) {
|
}).catch(function (error) {
|
||||||
self.notifications.showErrors(response);
|
if (typeof error.jqXHR !== 'undefined') {
|
||||||
|
self.notifications.showAPIError(error);
|
||||||
|
} else {
|
||||||
|
self.notifications.showErrors(error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user