MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / sew

Function sew

packages/web/src/middleware/sew.ts:14–27  ·  view source on GitHub ↗
(fn: () => Promise<T>)

Source from the content-addressed store, hash-verified

12 * and returns a generic unexpected service error.
13 */
14export const sew = async <T>(fn: () => Promise<T>): Promise<T | ServiceError> => {
15 try {
16 return await fn();
17 } catch (e) {
18 Sentry.captureException(e);
19 logger.error(e);
20
21 if (e instanceof ServiceErrorException) {
22 return e.serviceError;
23 }
24
25 return unexpectedError(`An unexpected error occurred. Please try again later.`);
26 }
27};

Callers 15

completeOnboardingFunction · 0.90
createApiKeyFunction · 0.90
deleteApiKeyFunction · 0.90
getUserApiKeysFunction · 0.90
getReposFunction · 0.90
getReposStatsFunction · 0.90
getConnectionStatsFunction · 0.90
getRepoInfoByNameFunction · 0.90
createAccountRequestFunction · 0.90
getSearchContextsFunction · 0.90
getRepoImageFunction · 0.90

Calls 1

unexpectedErrorFunction · 0.90

Tested by

no test coverage detected