diff --git a/js/src/common/Application.js b/js/src/common/Application.js index b9ebe2e45..aa115ad30 100644 --- a/js/src/common/Application.js +++ b/js/src/common/Application.js @@ -377,7 +377,8 @@ export default class Application { const isDebug = app.forum.attribute('debug'); // contains a formatted errors if possible, response must be an JSON API array of errors // the details property is decoded to transform escaped characters such as '\n' - const formattedError = error.response && Array.isArray(error.response.errors) && error.response.errors.map((e) => decodeURI(e.detail)); + const errors = error.response && error.response.errors; + const formattedError = Array.isArray(errors) && errors[0] && errors[0].detail && errors.map((e) => decodeURI(e.detail)); error.alert = { type: 'error', diff --git a/js/src/common/components/RequestErrorModal.js b/js/src/common/components/RequestErrorModal.js index af460e91e..297f2a462 100644 --- a/js/src/common/components/RequestErrorModal.js +++ b/js/src/common/components/RequestErrorModal.js @@ -6,11 +6,11 @@ export default class RequestErrorModal extends Modal { } title() { - return this.props.error.xhr ? `${this.props.error.xhr.status} ${this.props.error.xhr.statusText}` : ''; + return this.attrs.error.xhr ? `${this.attrs.error.xhr.status} ${this.attrs.error.xhr.statusText}` : ''; } content() { - const { error, formattedError } = this.props; + const { error, formattedError } = this.attrs; let responseText; @@ -31,7 +31,7 @@ export default class RequestErrorModal extends Modal { return (
-          {this.props.error.options.method} {this.props.error.options.url}
+          {this.attrs.error.options.method} {this.attrs.error.options.url}
           

{responseText}