Exception: Error::CustomError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/error/custom_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status = :bad_request, message = nil, details: nil) ⇒ CustomError

Returns a new instance of CustomError.



5
6
7
8
9
# File 'lib/error/custom_error.rb', line 5

def initialize(status = :bad_request, message = nil, details: nil)
  @status  = status
  @details = details
  super(message || "Something went wrong")
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



3
4
5
# File 'lib/error/custom_error.rb', line 3

def details
  @details
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/error/custom_error.rb', line 3

def status
  @status
end