fix error message

This commit is contained in:
Thomas Ruoff
2018-01-07 23:17:23 +00:00
parent 147d004fb3
commit d596639247
2 changed files with 2 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ class App extends Component {
.catch((error) => {
this.setState({
pdfIsLoading: false,
pdfError: error,
pdfError: error.message,
pdfUrl: null
});
});

View File

@@ -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();
});