MCPcopy Create free account
hub / github.com/ampproject/amphtml / tryCallback

Function tryCallback

src/core/error/index.js:84–90  ·  view source on GitHub ↗
(callback, ...args)

Source from the content-addressed store, hash-verified

82 * @template S
83 */
84export function tryCallback(callback, ...args) {
85 try {
86 return callback.apply(null, args);
87 } catch (e) {
88 rethrowAsync(e);
89 }
90}
91
92/**
93 * Creates an error object with its expected property set to true.

Callers 4

forAllWithinInternalFunction · 0.90
computeAndCallFunction · 0.90
cleanup_Method · 0.90
scan_Method · 0.90

Calls 2

rethrowAsyncFunction · 0.85
applyMethod · 0.80

Tested by

no test coverage detected