(reason: string)
| 187 | } |
| 188 | |
| 189 | cancel(reason: string): void { |
| 190 | if (this.done) { |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | try { |
| 195 | this.bridge.postMessage({ type: "orpcStreamCancel", streamId: this.streamId }); |
| 196 | } catch { |
| 197 | // Best-effort: the webview might be disposed. |
| 198 | } |
| 199 | |
| 200 | this.fail(new Error(`Stream cancelled: ${reason}`)); |
| 201 | } |
| 202 | |
| 203 | async next(): Promise<IteratorResult<T>> { |
| 204 | if (this.error) { |
no test coverage detected