MCPcopy
hub / github.com/posthtml/posthtml / tryCatch

Function tryCatch

lib/index.js:298–304  ·  view source on GitHub ↗

* Simple try/catch helper, if exists, returns result * * @private * * @param {Function} tryFn - try block * @param {Function} catchFn - catch block * @returns {?*}

(tryFn, catchFn)

Source from the content-addressed store, hash-verified

296 * @returns {?*}
297 */
298function tryCatch (tryFn, catchFn) {
299 try {
300 return tryFn()
301 } catch (err) {
302 catchFn(err)
303 }
304}
305
306/**
307 * Wraps the PostHTMLTree within an object using a getter to render HTML on demand.

Callers 1

nextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…