()
| 34 | export class EventTooLarge extends Data.TaggedError("EventTooLarge")<{ |
| 35 | readonly maxEventSize: number |
| 36 | }> { |
| 37 | override get message() { |
| 38 | return `Pending SSE event exceeded the maximum size of ${this.maxEventSize}` |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Union of Server-Sent Events decoding error reasons. |
| 44 | * |
| 45 | * @category errors |
| 46 | * @since 4.0.0 |
| 47 | */ |
| 48 | export type SseErrorReason = EventTooLarge |
| 49 | |
| 50 | /** |
| 51 | * Error raised when decoding a Server-Sent Events stream fails. |
| 52 | * |
| 53 | * @category errors |
| 54 | * @since 4.0.0 |
| 55 | */ |
| 56 | export class SseError extends Data.TaggedError("SseError")<{ |
| 57 | readonly reason: SseErrorReason |
| 58 | }> { |
| 59 | /** |
| 60 | * Marks this value as an SSE decoding error. |
| 61 | * |
| 62 | * @since 4.0.0 |
| 63 | */ |
| 64 | readonly [SseErrorTypeId] = SseErrorTypeId |
| 65 | |
| 66 | /** |
| 67 | * Delegates the public message to the underlying SSE error reason. |
| 68 | * |
| 69 | * @since 4.0.0 |
| 70 | */ |
| 71 | override get message() { |
| 72 | return this.reason.message |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Options for decoding Server-Sent Events streams. |
no test coverage detected
searching dependent graphs…