Skip to content

Commit e795c01

Browse files
error handling for 4xx and 5xx
1 parent 683ef04 commit e795c01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/updateNickname.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export async function updateNickName(
2020
});
2121
if (nameChangeResponse.ok) {
2222
return await nameChangeResponse.json();
23+
} else {
24+
console.log(nameChangeResponse.json());
25+
return INTERNAL_SERVER_ERROR;
2326
}
2427
} catch (error) {
2528
console.log(error);

0 commit comments

Comments
 (0)