Fix language not found not responding
This commit is contained in:
parent
481a9978d5
commit
8b25b609c6
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ class Myriad {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
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'];
|
return [false, 'Invalid language'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class Myriad {
|
||||||
return [false, 'Evaluation timed out'];
|
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();
|
const body = await response.json();
|
||||||
|
|
Loading…
Reference in a new issue