Sha256: 87aa89c9e20a06c110dd66e64cd0b1b27813bb6cf8a9aa6fd904cf581213fbba

Contents?: true

Size: 435 Bytes

Versions: 39

Compression:

Stored size: 435 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

39 entries across 39 versions & 1 rubygems

Version Path
caren-api-0.4.30 lib/caren/error.rb
caren-api-0.4.29 lib/caren/error.rb
caren-api-0.4.28 lib/caren/error.rb
caren-api-0.4.27 lib/caren/error.rb
caren-api-0.4.26 lib/caren/error.rb
caren-api-0.4.25 lib/caren/error.rb
caren-api-0.4.24 lib/caren/error.rb
caren-api-0.4.23 lib/caren/error.rb
caren-api-0.4.22 lib/caren/error.rb
caren-api-0.4.21 lib/caren/error.rb
caren-api-0.4.20 lib/caren/error.rb
caren-api-0.4.19 lib/caren/error.rb
caren-api-0.4.18 lib/caren/error.rb
caren-api-0.4.17 lib/caren/error.rb
caren-api-0.4.16 lib/caren/error.rb
caren-api-0.4.15 lib/caren/error.rb
caren-api-0.4.14 lib/caren/error.rb
caren-api-0.4.13 lib/caren/error.rb
caren-api-0.4.12 lib/caren/error.rb
caren-api-0.4.11 lib/caren/error.rb