Sha256: 1a3f3c67167c16d036df1ef5f3cff766d3c9cd98d5c83367a2798d6db87e9d17

Contents?: true

Size: 492 Bytes

Versions: 4

Compression:

Stored size: 492 Bytes

Contents

module UniversaTools

  class MessageException < Exception;
  end

  class CodeException < MessageException
    attr :code

    def initialize code, text = nil
      text ||= code
      @code = code
      super(text)
    end
  end

  class NotFoundException < CodeException
    def initialize object
      super(:file_not_found, "not found: #{object}")
    end
  end

  class InsufficientFundsException < CodeException
    def initialize
      super(:insufficient_funds)
    end
  end

end


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
universa_tools-0.1.7 lib/universa_tools/errors.rb
universa_tools-0.1.6 lib/universa_tools/errors.rb
universa_tools-0.1.5 lib/universa_tools/errors.rb
universa_tools-0.1.4 lib/universa_tools/errors.rb