Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/utils/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ export async function generateE2BUserAccessToken(supabaseAccessToken: string) {
})

if (res.error) {
logError(ERROR_CODES.INFRA, '/access-tokens', res.error, res.data)
logError(
ERROR_CODES.INFRA,
'/access-tokens',
res.response.status,
res.error,
res.data
)

return returnServerError(`Failed to generate e2b user access token`)
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/keys/get-api-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const getTeamApiKeys = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500
logError(ERROR_CODES.INFRA, '/api-keys', res.error)
const status = res.response.status
logError(ERROR_CODES.INFRA, '/api-keys', status, res.error, res.data)

return handleDefaultInfraError(status)
}
Expand Down
12 changes: 9 additions & 3 deletions src/server/sandboxes/get-sandbox-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ export const getSandboxDetails = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500

logError(ERROR_CODES.INFRA, '/sandboxes/{sandboxID}', res.error, res.data)
const status = res.response.status

logError(
ERROR_CODES.INFRA,
'/sandboxes/{sandboxID}',
status,
res.error,
res.data
)

if (status === 404) {
return returnServerError(
Expand Down
4 changes: 2 additions & 2 deletions src/server/sandboxes/get-team-sandboxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const getTeamSandboxes = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500
const status = res.response.status

logError(ERROR_CODES.INFRA, '/sandboxes', res.error, res.data)
logError(ERROR_CODES.INFRA, '/sandboxes', status, res.error, res.data)

return handleDefaultInfraError(status)
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/templates/get-team-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const getTeamTemplates = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500
logError(ERROR_CODES.INFRA, '/templates', res.error, res.data)
const status = res.response.status
logError(ERROR_CODES.INFRA, '/templates', status, res.error, res.data)

return handleDefaultInfraError(status)
}
Expand Down
13 changes: 10 additions & 3 deletions src/server/templates/templates-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ export const deleteTemplateAction = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500
const status = res.response.status
logError(
ERROR_CODES.INFRA,
'/templates/{templateID}',
status,
res.error,
res.data
)
Expand Down Expand Up @@ -91,8 +92,14 @@ export const updateTemplateAction = authActionClient
})

if (res.error) {
const status = res.error?.code ?? 500
logError(ERROR_CODES.INFRA, '/templates/{templateID}', res.error)
const status = res.response.status
logError(
ERROR_CODES.INFRA,
'/templates/{templateID}',
status,
res.error,
res.data
)

if (status === 404) {
return returnServerError('Template not found')
Expand Down