Skip to content

Commit

Permalink
Preserve error types during translation
Browse files Browse the repository at this point in the history
By preserving the exception type, more fine-grained error handling can be performed via client-side logic (e.g. redirect to a search page if a PDF is not found, or to a ticket system in case of invalid PDF files).

The original exception is now re-thrown.

Fixes mozilla#11658
  • Loading branch information
xelan committed Apr 28, 2020
1 parent a13db5d commit f5fd24a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ const PDFViewerApplication = {

return loadingErrorMessage.then(msg => {
this.error(msg, { message });
throw new Error(msg);
throw exception;
});
}
);
Expand Down

0 comments on commit f5fd24a

Please sign in to comment.