mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
fix error message
This commit is contained in:
@@ -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
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user