MCPcopy Create free account
hub / github.com/Hello-Application-XH/HelloGML / attempt

Function attempt

src/utils.ts:181–187  ·  view source on GitHub ↗
(fn: () => T)

Source from the content-addressed store, hash-verified

179}
180
181export function attempt<T>(fn: () => T): T | Error {
182 try {
183 return fn();
184 } catch (err) {
185 return err instanceof Error ? err : new Error(String(err));
186 }
187}
188
189export function isError(value: any): boolean {
190 return value instanceof Error;

Callers 3

receiveStreamFunction · 0.90
startFunction · 0.90
receiveImagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected