Sha256: 8fd5c4e5d9e944824d70ffe6b5cbc842282611d28671fce9bc5632eb8fa04298
Contents?: true
Size: 793 Bytes
Versions: 7
Compression:
Stored size: 793 Bytes
Contents
# frozen_string_literal: true module Lite module Command class FaultStreamer attr_reader :command, :object def initialize(command, object) @command = command @object = object end def caused_by Utils.try(object, :caused_by) || command end def thrown_by return object if Utils.try(object, :executed?) Utils.try(object, :thrown_by) || command.caused_by end def metadata Utils.try(object, :metadata) || command.metadata end def reason if object.respond_to?(:reason) object.reason elsif object.is_a?(StandardError) "[#{object.class.name}] #{object.message}".chomp(".") else object end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems