Skip to content

Commit

Permalink
Handle all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Sep 14, 2024
1 parent a78f741 commit 573f3b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ServerProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 573f3b1

Please sign in to comment.