Exception: HCast::Errors::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hcast/errors.rb

Overview

Raised when hash has validation errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, errors) ⇒ ValidationError

Returns a new instance of ValidationError.



54
55
56
57
# File 'lib/hcast/errors.rb', line 54

def initialize(message, errors)
  @errors = errors
  super(message)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



52
53
54
# File 'lib/hcast/errors.rb', line 52

def errors
  @errors
end

Instance Method Details

#messageObject



59
60
61
# File 'lib/hcast/errors.rb', line 59

def message
  "#{@message}\n#{errors.to_hash}"
end

#short_messageObject



63
64
65
# File 'lib/hcast/errors.rb', line 63

def short_message
  'Validation error'
end