diff --git a/packages/web/src/actions.ts b/packages/web/src/actions.ts index cc239fa9..056a5fd6 100644 --- a/packages/web/src/actions.ts +++ b/packages/web/src/actions.ts @@ -38,8 +38,8 @@ const auditService = getAuditService(); /** * "Service Error Wrapper". * - * Captures any thrown exceptions and converts them to a unexpected - * service error. Also logs them with Sentry. + * Captures any thrown exceptions, logs them to the console and Sentry, + * and returns a generic unexpected service error. */ export const sew = async (fn: () => Promise): Promise => { try { @@ -52,10 +52,6 @@ export const sew = async (fn: () => Promise): Promise => return e.serviceError; } - if (e instanceof Error) { - return unexpectedError(e.message); - } - return unexpectedError(`An unexpected error occurred. Please try again later.`); } }