mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-26 05:36:38 +00:00
[bugfix] Catch json syntax errors in the frontend + display a more helpful message (#804)
* catch json syntax errors * update error msg * re-throw error with cause Co-authored-by: f0x52 <f0x@cthu.lu>
This commit is contained in:
parent
58c00d9f2f
commit
ee01e030d4
|
@ -184,6 +184,12 @@ module.exports = function oauthClient(config, initState) {
|
||||||
} else {
|
} else {
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
if (e instanceof SyntaxError) {
|
||||||
|
throw new Error("Error: The GtS API returned a non-json error. This usually means a network problem, or an issue with your instance's reverse proxy configuration.", {cause: e});
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue