diff --git a/client/src/App.js b/client/src/App.js index e0fc41f..fb1b598 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -45,7 +45,7 @@ class App extends Component { .catch((error) => { this.setState({ pdfIsLoading: false, - pdfError: error, + pdfError: error.message, pdfUrl: null }); }); diff --git a/client/src/apiHelper.js b/client/src/apiHelper.js index 84a150b..ce33fc6 100644 --- a/client/src/apiHelper.js +++ b/client/src/apiHelper.js @@ -7,8 +7,7 @@ export function generatePdf(state){ body: JSON.stringify(state) }).then(function(res) { if (res.status !== 200) { - console.error('request failed'); - return; + throw new Error(`Something went wrong (Status ${res.status}) - I do feel very sorry!`); } return res.json(); });