Skip to content

Commit

Permalink
Merge pull request #229 from mgreminger/export-fixes-2
Browse files Browse the repository at this point in the history
fix: better rendering of docgen response errors
  • Loading branch information
mgreminger authored Jan 15, 2024
2 parents 4ef6fea + 279e63a commit cb7d197
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1768,11 +1768,14 @@ Please include a link to this sheet in the email to assist in debugging the prob
modalInfo.modalOpen = false;
} else {
if (response.status === 413) {
throw new Error('Sheet too large for document conversion, reduce size of images and try to resubmit. Height and width of any images should be 800 pixels or less.');
} else {
throw new Error(`${response.status} ${await response.text()}`);
let errorMessage = await response.text();
try {
const errorObject = JSON.parse(errorMessage);
errorMessage = errorObject.detail;
} catch {
}
throw new Error(`${response.status} ${errorMessage}`);
}
} catch (error) {
console.log(`Error creating ${docType} document: ${error}`);
Expand Down

0 comments on commit cb7d197

Please sign in to comment.