diff --git a/js/components/global_notification.js b/js/components/global_notification.js index aefe525a..59663b28 100644 --- a/js/components/global_notification.js +++ b/js/components/global_notification.js @@ -53,6 +53,11 @@ let GlobalNotification = React.createClass({ onChange(state) { let notification = this.extractFirstElem(state.notificationQue); + // error handling for notifications + if(notification.message && notification.type === 'danger') { + console.logGlobal(new Error(notification.message.message)); + } + if(notification.show) { this.setState(notification); } else { diff --git a/js/utils/requests.js b/js/utils/requests.js index 4341adde..ea923576 100644 --- a/js/utils/requests.js +++ b/js/utils/requests.js @@ -19,9 +19,9 @@ class Requests { unpackResponse(response) { if (response.status >= 500) { - console.logGlobal(new Error(response.status + ': Generic server error - ' + response.statusText)); + console.logGlobal(new Error(response.status + ' - ' + response.statusText + ' - on URL:' + response.url)); } else if(response.status >= 400 && response.status < 500) { - console.logGlobal(new Error(response.status + ': Generic request error - ' + response.statusText)); + console.logGlobal(new Error(response.status + ' - ' + response.statusText + ' - on URL:' + response.url)); } return response.text(); }