We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent efecb62 commit 5233336Copy full SHA for 5233336
1 file changed
packages/web/src/actions.ts
@@ -38,8 +38,8 @@ const auditService = getAuditService();
38
/**
39
* "Service Error Wrapper".
40
*
41
- * Captures any thrown exceptions and converts them to a unexpected
42
- * 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.
43
*/
44
export const sew = async <T>(fn: () => Promise<T>): Promise<T | ServiceError> => {
45
try {
@@ -52,10 +52,6 @@ export const sew = async <T>(fn: () => Promise<T>): Promise<T | ServiceError> =>
52
return e.serviceError;
53
}
54
55
- if (e instanceof Error) {
56
- return unexpectedError(e.message);
57
- }
58
-
59
return unexpectedError(`An unexpected error occurred. Please try again later.`);
60
61
0 commit comments