MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / withTrace

Function withTrace

tools/challenge-helper-scripts/helpers/utils.ts:12–19  ·  view source on GitHub ↗
(
  fn: (...x: Args) => Promise<Result>,
  ...args: Args
)

Source from the content-addressed store, hash-verified

10// fs Promise functions return errors, but no stack trace. This adds back in
11// the stack trace.
12export function withTrace<Args extends unknown[], Result>(
13 fn: (...x: Args) => Promise<Result>,
14 ...args: Args
15): Promise<Result> {
16 return fn(...args).catch((reason: Error) => {
17 throw Error(reason.message);
18 });
19}

Callers 5

renameBlockFunction · 0.90
updateIntroJsonFunction · 0.85
updateIntroJsonFunction · 0.85
updateIntroJsonFunction · 0.85
parseIntroJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected