MCPcopy Create free account
hub / github.com/nodejs/node / isErrorLike

Function isErrorLike

deps/undici/src/lib/web/fetch/util.js:105–110  ·  view source on GitHub ↗
(object)

Source from the content-addressed store, hash-verified

103}
104
105function isErrorLike (object) {
106 return object instanceof Error || (
107 object?.constructor?.name === 'Error' ||
108 object?.constructor?.name === 'DOMException'
109 )
110}
111
112// Check whether |statusText| is a ByteString and
113// matches the Reason-Phrase token production.

Callers 2

onAbortedFunction · 0.70
makeNetworkErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected