Fix fetch doesn't throw error when 500
This commit is contained in:
parent
05ee27e045
commit
f19326528b
|
@ -35,7 +35,10 @@ function _lingvaTranslate(text, source, target) {
|
|||
text,
|
||||
)}`,
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
if (!res.ok) throw new Error(res.statusText);
|
||||
return res.json();
|
||||
})
|
||||
.then((res) => {
|
||||
return {
|
||||
provider: 'lingva',
|
||||
|
|
Loading…
Reference in a new issue