Dispatch `RETRYING` SSE event (#585)

This commit is contained in:
Ben Croker 2025-02-04 15:41:10 -06:00 committed by GitHub
parent 437f8bcf53
commit 552c55939d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import {
type DatastarSSEEvent,
ERROR,
FINISHED,
RETRYING,
STARTED,
} from '../shared'
@ -152,6 +153,7 @@ export const sse = async (
// do nothing and it will retry
if (error) {
console.error(error.message)
dispatchSSE(RETRYING, { message: error.message })
}
},
}

View File

@ -6,6 +6,7 @@ export const SWAPPING_CLASS = `${DATASTAR}-swapping`
export const STARTED = 'started'
export const FINISHED = 'finished'
export const ERROR = 'error'
export const RETRYING = 'retrying'
export interface DatastarSSEEvent {
type: string