(error: Error)
| 614 | } |
| 615 | |
| 616 | private reportStreamError(error: Error): void { |
| 617 | const alreadyReported = |
| 618 | this.errorReportedGeneration === this.streamGeneration |
| 619 | this.setError(error) |
| 620 | // Preserve request-level error semantics even if a RUN_ERROR arrives |
| 621 | // slightly after loading flips false during stream teardown. |
| 622 | if ( |
| 623 | this.isLoading || |
| 624 | this.status === 'submitted' || |
| 625 | this.status === 'streaming' |
| 626 | ) { |
| 627 | this.setStatus('error') |
| 628 | } |
| 629 | if (!alreadyReported) { |
| 630 | this.errorReportedGeneration = this.streamGeneration |
| 631 | this.callbacksRef.current.onError(error) |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | /** |
| 636 | * Start the background subscription loop. |
no test coverage detected