Sha256: 1946f08db0183a81ea34beb00cfb7bc37305780ff971548a281bda389f6fb805

Contents?: true

Size: 422 Bytes

Versions: 17

Compression:

Stored size: 422 Bytes

Contents

# This class provides a wrapper for caren's server side errors.
class Caren::Error

  attr_accessor :category, :message, :attributes

  def initialize category, message="", attributes={}
    self.category = category
    self.message = message
    self.attributes = attributes
  end

end

class Caren::ValidationError < Caren::Error

  def field
    attributes[:on]
  end

  def to_s
    "`#{field}` #{message}"
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
caren-api-0.5.13 lib/caren/error.rb
caren-api-0.5.12 lib/caren/error.rb
caren-api-0.5.10 lib/caren/error.rb
caren-api-0.5.9 lib/caren/error.rb
caren-api-0.5.8 lib/caren/error.rb
caren-api-0.5.7 lib/caren/error.rb
caren-api-0.5.6 lib/caren/error.rb
caren-api-0.5.5 lib/caren/error.rb
caren-api-0.5.4 lib/caren/error.rb
caren-api-0.5.3 lib/caren/error.rb
caren-api-0.5.2 lib/caren/error.rb
caren-api-0.5.1 lib/caren/error.rb
caren-api-0.5.0 lib/caren/error.rb
caren-api-0.4.34 lib/caren/error.rb
caren-api-0.4.33 lib/caren/error.rb
caren-api-0.4.32 lib/caren/error.rb
caren-api-0.4.31 lib/caren/error.rb