Skip to content

Commit 5233336

Browse files
return generic unexpected service error in sew
1 parent efecb62 commit 5233336

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/web/src/actions.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const auditService = getAuditService();
3838
/**
3939
* "Service Error Wrapper".
4040
*
41-
* Captures any thrown exceptions and converts them to a unexpected
42-
* service error. Also logs them with Sentry.
41+
* Captures any thrown exceptions, logs them to the console and Sentry,
42+
* and returns a generic unexpected service error.
4343
*/
4444
export const sew = async <T>(fn: () => Promise<T>): Promise<T | ServiceError> => {
4545
try {
@@ -52,10 +52,6 @@ export const sew = async <T>(fn: () => Promise<T>): Promise<T | ServiceError> =>
5252
return e.serviceError;
5353
}
5454

55-
if (e instanceof Error) {
56-
return unexpectedError(e.message);
57-
}
58-
5955
return unexpectedError(`An unexpected error occurred. Please try again later.`);
6056
}
6157
}

0 commit comments

Comments
 (0)