Sha256: c49bd89a85ee82989faf70002875a9c409162b4a935059ad352ff202ac556afa

Contents?: true

Size: 627 Bytes

Versions: 3

Compression:

Stored size: 627 Bytes

Contents

class SelfData
  Error = Class.new(StandardError)

  class NoDataFound < Error
    attr_reader :file

    def initialize(file = nil)
      @file = file
      super("No data found in #{file}")
    end
  end

  class ConverterNotFound < Error
    attr_reader :format

    def initialize(format = nil)
      @format = format
      super("Not found converter for #{format}")
    end
  end

  class ConversionError < Error
    attr_reader :real_error, :format

    def initialize(format = nil, real_error = nil)
      @format = format
      @real_error = real_error
      super("#{format}: #{real_error.inspect}")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
self_data-1.0.0 lib/self_data/errors.rb
self_data-0.1.1 lib/self_data/errors.rb
self_data-0.1.0 lib/self_data/errors.rb