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) => { .catch((error) => {
this.setState({ this.setState({
pdfIsLoading: false, pdfIsLoading: false,
pdfError: error, pdfError: error.message,
pdfUrl: null pdfUrl: null
}); });
}); });

View File

@@ -7,8 +7,7 @@ export function generatePdf(state){
body: JSON.stringify(state) body: JSON.stringify(state)
}).then(function(res) { }).then(function(res) {
if (res.status !== 200) { if (res.status !== 200) {
console.error('request failed'); throw new Error(`Something went wrong (Status ${res.status}) - I do feel very sorry!`);
return;
} }
return res.json(); return res.json();
}); });