Class: Glia::Errors::ResourceNotFoundError

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

Constant Summary

Constants inherited from Error

Error::SNAKE_CASE_REGEX

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.



128
129
130
131
132
133
134
135
136
137
# File 'lib/glia/errors/client_errors.rb', line 128

def initialize(resource:, message: nil)
  assert_snake_case(resource)

  super(
    type: RESOURCE_NOT_FOUND_ERROR,
    ref: create_ref(RESOURCE_NOT_FOUND_ERROR),
    message: message || "#{Naming.humanize(resource)} not found",
    error_details: { resource: resource }
  )
end