Skip to content

Commit 83774f5

Browse files
Add supabase error log config + logging for get-team-members (#30)
2 parents bd2733a + 4a7eafd commit 83774f5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/configs/logs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const ERROR_CODES = {
66
INFRA: 'INFRA_ERROR',
77
GUARD: 'GUARD_ERROR',
88
EMAIL_VALIDATION: 'EMAIL_VALIDATION_ERROR',
9+
SUPABASE: 'SUPABASE_ERROR',
910
} as const
1011

1112
export const INFO_CODES = {

src/server/team/get-team-members.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { z } from 'zod'
66
import { TeamMemberInfo } from './types'
77
import { authActionClient } from '@/lib/clients/action'
88
import { returnServerError } from '@/lib/utils/action'
9+
import { logError } from '@/lib/clients/logger'
10+
import { ERROR_CODES } from '@/configs/logs'
911

1012
const GetTeamMembersSchema = z.object({
1113
teamId: z.string().uuid(),
@@ -26,6 +28,8 @@ export const getTeamMembers = authActionClient
2628
.single()
2729

2830
if (userTeamsRelationError) {
31+
logError(ERROR_CODES.SUPABASE, userTeamsRelationError)
32+
2933
return returnServerError('User is not authorized to get team members')
3034
}
3135

0 commit comments

Comments
 (0)