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

Function unwrapServiceError

packages/web/src/lib/utils.ts:584–591  ·  view source on GitHub ↗
(promise: Promise<ServiceError | T>)

Source from the content-addressed store, hash-verified

582 * @returns The data from the promise.
583 */
584export const unwrapServiceError = async <T>(promise: Promise<ServiceError | T>): Promise<T> => {
585 const data = await promise;
586 if (isServiceError(data)) {
587 throw new Error(data.message);
588 }
589
590 return data;
591}
592
593export const getRepoImageSrc = (imageUrl: string | undefined, repoId: number): string | undefined => {
594 if (!imageUrl) return undefined;

Callers 15

useSuggestionsDataFunction · 0.90
useOffersFunction · 0.90
useSuggestionsDataFunction · 0.90
PermissionSyncBannerFunction · 0.90
RepoIndexedGuardFunction · 0.90
WhatsNewSidebarButtonFunction · 0.90
CodePreviewPanelFunction · 0.90
InvitePanelFunction · 0.90
FileSearchCommandDialogFunction · 0.90
FileTreePanelFunction · 0.90

Calls 1

isServiceErrorFunction · 0.85

Tested by

no test coverage detected