feat: add initial api logging (#1494)
Improve API logging and error handling between client and server side.
This commit is contained in:
@@ -100,10 +100,9 @@ export const profileRouter = router({
|
||||
);
|
||||
|
||||
if (subscriptions.length === 0) {
|
||||
throw new AppError(
|
||||
AppErrorCode.PREMIUM_PROFILE_URL,
|
||||
'Only subscribers can have a username shorter than 6 characters',
|
||||
);
|
||||
throw new AppError(AppErrorCode.PREMIUM_PROFILE_URL, {
|
||||
message: 'Only subscribers can have a username shorter than 6 characters',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +122,7 @@ export const profileRouter = router({
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
if (error.code !== AppErrorCode.UNKNOWN_ERROR) {
|
||||
throw AppError.parseErrorToTRPCError(error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
throw new TRPCError({
|
||||
|
||||
Reference in New Issue
Block a user