Class: RubyEventStore::CLI::Commands::EventShow

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_event_store/cli/commands/event_show.rb

Instance Method Summary collapse

Instance Method Details

#call(event_id:) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_event_store/cli/commands/event_show.rb', line 15

def call(event_id:, **)
  event = event_store.read.event!(event_id)
  print_event(event)
rescue RubyEventStore::EventNotFound
  warn "Event not found: #{event_id}"
  exit 1
rescue => e
  warn e.message
  exit 1
end