Exception: Fanforce::Error::NotFound

Inherits:
Fanforce::Error show all
Defined in:
lib/fanforce/errors/errors.rb

Overview

Method or record could not be found

Instance Attribute Summary

Attributes inherited from Fanforce::Error

#env, #public_errors

Instance Method Summary collapse

Methods inherited from Fanforce::Error

#curl_command, #for, #format_error, #format_errors

Constructor Details

#initialize(*args) ⇒ NotFound

Returns a new instance of NotFound.



73
74
75
76
77
78
79
80
81
82
# File 'lib/fanforce/errors/errors.rb', line 73

def initialize(*args)
  if args[0].is_a?(Hash)
    super(*args)
  else
    super(
        resource: args[0].to_s.demodulize.singularize,
        message: args[1]
    )
  end
end

Instance Method Details

#codeObject



69
# File 'lib/fanforce/errors/errors.rb', line 69

def code; 404 end

#default_error_codeObject



72
# File 'lib/fanforce/errors/errors.rb', line 72

def default_error_code; :unknown end

#default_messageObject



70
# File 'lib/fanforce/errors/errors.rb', line 70

def default_message; 'Not Found' end

#valid_error_codesObject



71
# File 'lib/fanforce/errors/errors.rb', line 71

def valid_error_codes; [:record_not_found, :method_not_found] end