Skip to content

Commit 26d2ecf

Browse files
committed
error handling
1 parent 134776c commit 26d2ecf

File tree

2 files changed

+7
-5
lines changed
  • tooling/sparta/packages

2 files changed

+7
-5
lines changed

tooling/sparta/packages/discord/src/slashCommands/humans/verify.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ export async function handleVerifyCommand(
4949
"Verify command"
5050
);
5151

52-
try {
53-
// Check if the user already exists
54-
const userResponse = await client.getUserByDiscordId({
55-
discordUserId: userId,
56-
});
52+
// Check if the user already exists
53+
const userResponse = await client.getUserByDiscordId({
54+
discordUserId: userId,
55+
});
5756

57+
try {
5858
logger.debug({ userResponse }, "User response");
5959

6060
const user = userResponse.data.user;

tooling/sparta/packages/express/src/routes/users/users.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ router.get("/discord/:discordUserId", async (req: Request, res: Response) => {
250250
try {
251251
const { discordUserId } = req.params;
252252

253+
logger.debug({ discordUserId }, "Getting user by Discord ID");
254+
253255
if (!discordUserId) {
254256
return res.status(400).json({
255257
success: false,

0 commit comments

Comments
 (0)