diff --git a/src/components/translation-block.jsx b/src/components/translation-block.jsx index 06ce52de..339d4ca9 100644 --- a/src/components/translation-block.jsx +++ b/src/components/translation-block.jsx @@ -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',