Exception: ErrorsHelper::BadRequest

Inherits:
Base
  • Object
show all
Defined in:
lib/errors_helper/bad_request.rb

Instance Attribute Summary

Attributes inherited from Base

#code, #message

Instance Method Summary collapse

Methods inherited from Base

#inspect, #status, #to_hash

Constructor Details

#initialize(code: '00', status: nil) ⇒ BadRequest

Returns a new instance of BadRequest.



5
6
7
8
9
10
# File 'lib/errors_helper/bad_request.rb', line 5

def initialize(code: '00', status: nil)
  value = ErrorsHelper.build_response(code: code)
  super message: value[:message] || ErrorsHelper.build_response(code: '00')[:message],
        code: value[:code] || ErrorsHelper.build_response(code: '00')[:code],
        status: status || :bad_request
end