MCPcopy
hub / github.com/postcss/postcss / catchError

Function catchError

test/css-syntax-error.test.ts:20–31  ·  view source on GitHub ↗
(cb: () => Promise<any>)

Source from the content-addressed store, hash-verified

18}
19
20async function catchError(cb: () => Promise<any>): Promise<CssSyntaxError> {
21 try {
22 await cb()
23 } catch (e) {
24 if (isSyntaxError(e)) {
25 return e
26 } else {
27 throw e
28 }
29 }
30 throw new Error('Error was not thrown')
31}
32
33function parseError(
34 css: string,

Callers 1

Calls 1

isSyntaxErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…