Exception: BlockScore::ValidationError

Inherits:
BlockscoreError show all
Defined in:
lib/blockscore/error/validation_error.rb

Constant Summary collapse

@@http_status =
400

Instance Attribute Summary collapse

Attributes inherited from BlockscoreError

#error_type, #json_body, #message

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, json_body = nil, error_type = nil, param = nil, error_code = nil) ⇒ ValidationError

Returns a new instance of ValidationError.



12
13
14
15
16
17
18
19
20
# File 'lib/blockscore/error/validation_error.rb', line 12

def initialize(message=nil, json_body=nil,
            error_type=nil, param=nil, error_code=nil)

  super(message, json_body, @@http_status, error_type)

  @error_code = error_code
  @param = param

end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



7
8
9
# File 'lib/blockscore/error/validation_error.rb', line 7

def error_code
  @error_code
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



6
7
8
# File 'lib/blockscore/error/validation_error.rb', line 6

def http_status
  @http_status
end

#paramObject (readonly)

Returns the value of attribute param.



8
9
10
# File 'lib/blockscore/error/validation_error.rb', line 8

def param
  @param
end

Instance Method Details

#to_sObject



22
23
24
25
# File 'lib/blockscore/error/validation_error.rb', line 22

def to_s
  s = "Status: #{@@http_status}, Type: #{@error_type}, Param: #{@param}, "
  s += "Code: #{@error_code}, Message: #{@message}"
end