Sha256: 1760ade3dd45fcef1f1d5c77af6f85336ea957fff03ac4dccc940c7eb6ccaab2

Contents?: true

Size: 372 Bytes

Versions: 3

Compression:

Stored size: 372 Bytes

Contents

module Restly::Error

  class StandardError < ::StandardError

    def message
      defined?(IRB) ? super.red : super
    end

  end

  errors = %w{
    RecordNotFound
    InvalidClient
    InvalidObject
    InvalidConnection
    MissingId
    InvalidSpec
    AssociationError
  }

  errors.each do |error|
    const_set(error.to_sym, Class.new(StandardError))
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restly-0.0.1.alpha.9 lib/restly/error.rb
restly-0.0.1.alpha.8 lib/restly/error.rb
restly-0.0.1.alpha.7 lib/restly/error.rb