mirror of
https://github.com/sune-org/ORP.git
synced 2026-01-13 16:17:59 +00:00
Fix: Append error messages to the chat stream
This commit is contained in:
4
index.js
4
index.js
@@ -414,9 +414,11 @@ export class MyDurableObject {
|
|||||||
|
|
||||||
fail(message) {
|
fail(message) {
|
||||||
if (this.phase !== 'running') return;
|
if (this.phase !== 'running') return;
|
||||||
|
const errStr = String(message || 'stream_failed');
|
||||||
|
this.queueDelta(`\n\nRun failed: ${errStr}`);
|
||||||
this.flush(true);
|
this.flush(true);
|
||||||
this.phase = 'error';
|
this.phase = 'error';
|
||||||
this.error = String(message || 'stream_failed');
|
this.error = errStr;
|
||||||
try { this.controller?.abort(); } catch {}
|
try { this.controller?.abort(); } catch {}
|
||||||
try { this.oaStream?.controller?.abort(); } catch {}
|
try { this.oaStream?.controller?.abort(); } catch {}
|
||||||
this.saveSnapshot();
|
this.saveSnapshot();
|
||||||
|
|||||||
Reference in New Issue
Block a user