Skip to content

Commit 3a931fb

Browse files
committed
feat(sse): add raw frame contracts
1 parent 059d244 commit 3a931fb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package io.github.easy4j.hermes.api.sse;
2+
3+
/** Signals a business SSE consumer failure without misclassifying it as JSON decoding. */
4+
public final class SseConsumerException extends RuntimeException {
5+
private final String eventId;
6+
private final String eventName;
7+
8+
public SseConsumerException(SseFrame frame, Throwable cause) {
9+
super("Hermes SSE consumer failed for event "
10+
+ (frame.getEvent() == null ? "<unnamed>" : frame.getEvent()), cause);
11+
this.eventId = frame.getId();
12+
this.eventName = frame.getEvent();
13+
}
14+
15+
public String getEventId() { return eventId; }
16+
public String getEventName() { return eventName; }
17+
}

0 commit comments

Comments
 (0)