Skip to content

Commit 683ef04

Browse files
use constants and fix improper logging
1 parent 6161bf7 commit 683ef04

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/constants/responses.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ export const STATUS_CHECK = {
1515
};
1616

1717
export const COMMAND_NOT_FOUND = "Command Not Found";
18+
19+
export const INTERNAL_SERVER_ERROR =
20+
"Oops! We have encountered an internal Server Error";

src/utils/updateNickname.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { INTERNAL_SERVER_ERROR } from "../constants/responses";
12
import { DISCORD_BASE_URL } from "../constants/urls";
23
import { env } from "../typeDefinitions/default.types";
34

@@ -20,8 +21,8 @@ export async function updateNickName(
2021
if (nameChangeResponse.ok) {
2122
return await nameChangeResponse.json();
2223
}
23-
return "Some internal Server error occurred";
2424
} catch (error) {
2525
console.log(error);
26+
return INTERNAL_SERVER_ERROR;
2627
}
2728
}

0 commit comments

Comments
 (0)