Skip to content

Commit

Permalink
Fix: Restored html error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Sep 4, 2023
1 parent 42de26e commit 16b98eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion europeana.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ module.exports = class Europeana {
const res = await fetch (url, options);

// HTML error
if ( ! res.ok ) {
const body = await res.text();

Check failure on line 119 in europeana.js

View workflow job for this annotation

GitHub Actions / Node (20)

Trailing spaces not allowed

Check failure on line 119 in europeana.js

View workflow job for this annotation

GitHub Actions / Node (18)

Trailing spaces not allowed
if (body.match (/^</)) {
const error = new Error (this._errors[res.status]);

error.code = res.status;
Expand Down

0 comments on commit 16b98eb

Please sign in to comment.