diff --git a/framework/core/js/lib/App.js b/framework/core/js/lib/App.js index 618271348..f1d05594e 100644 --- a/framework/core/js/lib/App.js +++ b/framework/core/js/lib/App.js @@ -206,7 +206,7 @@ export default class App { try { return JSON.parse(responseText); } catch (e) { - throw new RequestError(500, responseText); + throw new RequestError(500, responseText, options, xhr); } }); @@ -230,7 +230,7 @@ export default class App { const status = xhr.status; if (status < 200 || status > 299) { - throw new RequestError(status, responseText, xhr); + throw new RequestError(status, responseText, options, xhr); } return responseText; diff --git a/framework/core/js/lib/components/RequestErrorModal.js b/framework/core/js/lib/components/RequestErrorModal.js index 5ef8468c0..90792d329 100644 --- a/framework/core/js/lib/components/RequestErrorModal.js +++ b/framework/core/js/lib/components/RequestErrorModal.js @@ -5,6 +5,12 @@ export default class RequestErrorModal extends Modal { return 'RequestErrorModal Modal--large'; } + title() { + return this.props.error.xhr + ? this.props.error.xhr.status+' '+this.props.error.xhr.statusText + : ''; + } + content() { let responseText; @@ -15,7 +21,10 @@ export default class RequestErrorModal extends Modal { } return
{responseText}+
+ {this.props.error.options.method} {this.props.error.options.url}
+ {responseText} +