MCPcopy Index your code
hub / github.com/tiann/hapi / setError

Method setError

cli/src/utils/PushableAsyncIterable.ts:59–67  ·  view source on GitHub ↗

* Set an error on the iterable

(err: Error)

Source from the content-addressed store, hash-verified

57 * Set an error on the iterable
58 */
59 setError(err: Error): void {
60 if (this.isDone) {
61 return
62 }
63
64 this.error = err
65 this.isDone = true
66 this.cleanup()
67 }
68
69 /**
70 * Cleanup waiting consumers

Callers 2

throwMethod · 0.95

Calls 1

cleanupMethod · 0.95

Tested by

no test coverage detected