From 8b25b609c6f13101ac0591d1a8ce6718684071f5 Mon Sep 17 00:00:00 2001 From: 1computer1 Date: Wed, 24 Jul 2019 06:01:17 -0400 Subject: [PATCH] Fix language not found not responding --- src/struct/Myriad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/struct/Myriad.js b/src/struct/Myriad.js index bc09240..e7d5acb 100644 --- a/src/struct/Myriad.js +++ b/src/struct/Myriad.js @@ -21,7 +21,7 @@ class Myriad { }); if (!response.ok) { - if (response.status === 404 && /^Language .+? was not found$/.test(response.statusText)) { + if (response.status === 404 && response.statusText === 'Not Found') { return [false, 'Invalid language']; } @@ -33,7 +33,7 @@ class Myriad { return [false, 'Evaluation timed out']; } - throw new Error(`Unexpected ${response.status} response from ['Myriad', ${response.statusText}`); + throw new Error(`Unexpected ${response.status} response from Myriad, ${response.statusText}`); } const body = await response.json();