MCPcopy Index your code
hub / github.com/postcss/postcss / catchError

Function catchError

test/processor.test.ts:36–43  ·  view source on GitHub ↗
(cb: () => Promise<any>)

Source from the content-addressed store, hash-verified

34}
35
36async function catchError(cb: () => Promise<any>): Promise<Error> {
37 try {
38 await cb()
39 } catch (e) {
40 if (e instanceof Error) return e
41 }
42 throw new Error('Error was not thrown')
43}
44
45let beforeFix = new Processor([
46 (root: Root) => {

Callers 1

processor.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…