Sha256: 8aa55df620c1b8f27964c1afd9c4b5e136076317eb38c82e767699a90ba88381

Contents?: true

Size: 660 Bytes

Versions: 14

Compression:

Stored size: 660 Bytes

Contents

module ChalkRuby
  # Base exception class for errors thrown by the ChalkRuby
  # client library. ChalkError will be raised by any
  # network operation if ChalkRuby.init() has not been called.
  #
  class ChalkError < StandardError
  end

  # An exception class raised when the REST API returns an error.
  # The error code and message will be parsed out of the HTTP response,
  # which is also included in the response attribute.
  #
  class ChalkHttpError < ChalkError
    attr_accessor :code, :message

    def initialize(code:, message:)
      self.code    = code
      self.message = message
      super("#{self.code}: #{self.message}")
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chalk_ruby-0.2.8 lib/chalk_ruby/error.rb
chalk_ruby-0.2.7 lib/chalk_ruby/error.rb
chalk_ruby-0.2.6 lib/chalk_ruby/error.rb
chalk_ruby-0.2.5 lib/chalk_ruby/error.rb
chalk_ruby-0.2.4 lib/chalk_ruby/error.rb
chalk_ruby-0.2.3 lib/chalk_ruby/error.rb
chalk_ruby-0.2.2 lib/chalk_ruby/error.rb
chalk_ruby-0.2.1 lib/chalk_ruby/error.rb
chalk_ruby-0.2.0 lib/chalk_ruby/error.rb
chalk_ruby-0.1.4 lib/chalk_ruby/error.rb
chalk_ruby-0.1.3 lib/chalk_ruby/error.rb
chalk_ruby-0.1.2 lib/chalk_ruby/error.rb
chalk_ruby-0.1.1 lib/chalk_ruby/error.rb
chalk_ruby-0.1.0 lib/chalk_ruby/error.rb