Skip to content

Commit

Permalink
Merge pull request #68 from Discusser/chore/print-errors-to-stderr
Browse files Browse the repository at this point in the history
Favor console.error for printing errors
  • Loading branch information
s1lvax authored Oct 22, 2024
2 parents e4a4f23 + 82a923c commit 059cf3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/utils/deleteUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const deleteUser = async (githubId: number, userId: number) => {
where: { githubId, id: userId }
});
} catch (error) {
console.log(error);
console.error(error);
throw Error('Failed to delete user');
}
};
2 changes: 1 addition & 1 deletion src/lib/utils/updateOpenToCollaborating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const updateOpenToCollaborating = async (githubId: number) => {
data: { openToCollaborating: newOpenToCollaboratingValue }
});
} catch (error) {
console.log(error);
console.error(error);
throw new Error('Failed to update openToCollaborating status');
}
};
8 changes: 4 additions & 4 deletions src/routes/profile/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const actions: Actions = {
});
}
} catch (err) {
console.log(err);
console.error(err);
return fail(500, { message: 'Something went wrong.' });
}
},
Expand Down Expand Up @@ -192,7 +192,7 @@ export const actions: Actions = {
});
}
} catch (err) {
console.log(err);
console.error(err);
return fail(500, { message: 'Something went wrong.' });
}
},
Expand All @@ -211,7 +211,7 @@ export const actions: Actions = {
//make sure it's the correct user
deleteUser(user.githubId, Number(id));
} catch (error) {
console.log(error);
console.error(error);
throw Error('Failed to delete user');
}
}
Expand All @@ -225,7 +225,7 @@ export const actions: Actions = {
// update value
updateOpenToCollaborating(user.githubId);
} catch (error) {
console.log(error);
console.error(error);
throw Error('Failed to delete user');
}
}
Expand Down

0 comments on commit 059cf3c

Please sign in to comment.