Skip to content

Commit 7bb5b79

Browse files
committed
feat(sse): sync protocol failure type
1 parent 8f6f698 commit 7bb5b79

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package io.github.easy4j.hermes.api.sse;
2+
3+
/** Signals an SSE protocol or frame-bound violation separately from transport and consumer failures. */
4+
public final class SseProtocolException extends RuntimeException {
5+
private final String eventId;
6+
private final String eventName;
7+
8+
public SseProtocolException(SseFrame frame, String message) {
9+
super(message);
10+
this.eventId = frame == null ? null : frame.getId();
11+
this.eventName = frame == null ? null : frame.getEvent();
12+
}
13+
14+
public String getEventId() { return eventId; }
15+
public String getEventName() { return eventName; }
16+
}

0 commit comments

Comments
 (0)