Class: Glia::Errors::ResourceNotFoundError

Inherits:
Error
  • Object
show all
Defined in:
lib/glia/errors/client_errors.rb

Instance Attribute Summary

Attributes inherited from Error

#error_details, #message, #ref, #type

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(resource:, message: nil) ⇒ ResourceNotFoundError

Returns a new instance of ResourceNotFoundError.



106
107
108
109
110
111
112
113
# File 'lib/glia/errors/client_errors.rb', line 106

def initialize(resource:, message: nil)
  super(
    type: RESOURCE_NOT_FOUND_ERROR,
    ref: "https://example.com/errors/#{RESOURCE_NOT_FOUND_ERROR}.html",
    message: "#{humanize(resource)} " + (message || 'not found'),
    error_details: { resource: resource }
  )
end