File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff 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 */
4444export 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}
You can’t perform that action at this time.
0 commit comments