feat: add initial api logging (#1494)

Improve API logging and error handling between client and server side.
This commit is contained in:
David Nguyen
2024-11-28 16:05:37 +07:00
committed by GitHub
parent 04293968c6
commit 98d85b086d
53 changed files with 933 additions and 780 deletions

View File

@@ -26,7 +26,7 @@ export const getUserPublicProfile = async ({
});
if (!user) {
throw new AppError(AppErrorCode.NOT_FOUND, 'User not found');
throw new AppError(AppErrorCode.NOT_FOUND, { message: 'User not found' });
}
// Create and return the public profile.
@@ -39,7 +39,7 @@ export const getUserPublicProfile = async ({
});
if (!profile) {
throw new AppError(AppErrorCode.NOT_FOUND, 'Failed to create public profile');
throw new AppError(AppErrorCode.NOT_FOUND, { message: 'Failed to create public profile' });
}
return {