Exception: Fluffle::Errors::CustomError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/fluffle/errors.rb

Overview

Raise this within your own code to get an error that will be faithfully translated into the code, message, and data member fields of the spec’s Error response object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseError

#to_response

Constructor Details

#initialize(code: 0, message:, data: nil) ⇒ CustomError

Returns a new instance of CustomError.



22
23
24
25
26
27
# File 'lib/fluffle/errors.rb', line 22

def initialize(code: 0, message:, data: nil)
  @code = code
  @data = data

  super message
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



20
21
22
# File 'lib/fluffle/errors.rb', line 20

def code
  @code
end

#dataObject

Returns the value of attribute data.



20
21
22
# File 'lib/fluffle/errors.rb', line 20

def data
  @data
end