(error: unknown)
| 172 | } |
| 173 | |
| 174 | fail(error: unknown): void { |
| 175 | if (this.done) { |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | this.done = true; |
| 180 | this.cleanup(); |
| 181 | this.error = error instanceof Error ? error : new Error(String(error)); |
| 182 | |
| 183 | while (this.pending.length > 0) { |
| 184 | const waiter = this.pending.shift(); |
| 185 | waiter?.reject(this.error); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | cancel(reason: string): void { |
| 190 | if (this.done) { |
no test coverage detected