Handle all errors

This commit is contained in:
Anton Tananaev 2024-09-14 07:27:12 -07:00
parent a78f741473
commit 573f3b148c

View File

@ -21,7 +21,8 @@ const ServerProvider = ({
if (response.ok) {
dispatch(sessionActions.updateServer(await response.json()));
} else {
throw Error(await response.text());
const message = await response.text();
throw Error(message || response.statusText);
}
} catch (error) {
setError(error.message);