mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-03 06:23:22 -04:00
Add additional Sentry error capture and refine profile data update logic
This commit is contained in:
@@ -134,6 +134,10 @@ export const validate = <T extends z.ZodTypeAny>(schema: T, val: unknown) => {
|
||||
if (issues.length > 0) {
|
||||
log.error(issues.map((i) => `${i.field}: ${i.context}`).join('\n'))
|
||||
}
|
||||
console.error('Validation failed', {issues, schema, val})
|
||||
Sentry.captureException(APIErrors.validationFailed(issues), {
|
||||
extra: {issues, schema, val},
|
||||
})
|
||||
throw APIErrors.validationFailed(issues)
|
||||
} else {
|
||||
return result.data as z.infer<T>
|
||||
|
||||
Reference in New Issue
Block a user