Sha256: c2da86343dae3f2a32a4259a1364a49eb30fdd735add8f89362437783c1ccbd7

Contents?: true

Size: 436 Bytes

Versions: 22

Compression:

Stored size: 436 Bytes

Contents

module Lookbook
  class LookbookError < StandardError
    attr_reader :scope, :original, :message

    def initialize(msg = nil, scope: nil, original: nil)
      @scope = scope
      @original = original
      @message = msg
      super(msg)
    end

    def full_message
      if msg.nil?
        message
      else
        scope_str = scope.nil? ? "[#{scope}]" : ""
        "#{scope_str} #{message}".strip
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
lookbook-1.5.5 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.5.4 lib/lookbook/support/errors/lookbook_error.rb
lookbook-2.0.0.beta.3 lib/lookbook/support/errors/lookbook_error.rb
lookbook-2.0.0.beta.2 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.5.3 lib/lookbook/support/errors/lookbook_error.rb
lookbook-2.0.0.beta.1 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.5.2 lib/lookbook/support/errors/lookbook_error.rb
lookbook-2.0.0.beta.0 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.5.1 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.5.0 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.5 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.4 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.3 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.2 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.1 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.4.0 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.3.4 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.3.3 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.3.1 lib/lookbook/support/errors/lookbook_error.rb
lookbook-1.3.0 lib/lookbook/support/errors/lookbook_error.rb