(requestId: string, error: string)
| 90 | } |
| 91 | |
| 92 | private finalizeError(requestId: string, error: string): void { |
| 93 | const state = this.requestStates.get(requestId) |
| 94 | if (!state || state.status !== 'running') { |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | state.status = 'failed' |
| 99 | state.event.sender.send(state.eventChannel, { |
| 100 | requestId, |
| 101 | type: 'error', |
| 102 | error |
| 103 | } as AIStreamChunk) |
| 104 | |
| 105 | this.cleanupRequest(requestId) |
| 106 | } |
| 107 | |
| 108 | private finalizeTerminalError(requestId: string, error: string): void { |
| 109 | const state = this.requestStates.get(requestId) |
no test coverage detected