Exception: JetstreamBridge::PublishError
- Defined in:
- lib/jetstream_bridge/errors.rb
Overview
Raised when an event fails to publish.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#event_id ⇒ String?
readonly
Event ID that failed to publish.
-
#subject ⇒ String?
readonly
NATS subject the publish was attempted on.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, event_id: nil, subject: nil, context: {}) ⇒ PublishError
constructor
A new instance of PublishError.
Constructor Details
#initialize(message = nil, event_id: nil, subject: nil, context: {}) ⇒ PublishError
Returns a new instance of PublishError.
48 49 50 51 52 |
# File 'lib/jetstream_bridge/errors.rb', line 48 def initialize( = nil, event_id: nil, subject: nil, context: {}) @event_id = event_id @subject = subject super(, context: context.merge(event_id: event_id, subject: subject).compact) end |
Instance Attribute Details
#event_id ⇒ String? (readonly)
Returns Event ID that failed to publish.
40 41 42 |
# File 'lib/jetstream_bridge/errors.rb', line 40 def event_id @event_id end |
#subject ⇒ String? (readonly)
Returns NATS subject the publish was attempted on.
42 43 44 |
# File 'lib/jetstream_bridge/errors.rb', line 42 def subject @subject end |