module Restforce::ErrorCode
Constants
- ERROR_EXCEPTION_CLASSES
Maps ‘errorCode`s returned from Salesforce to the exception class to be used for these errors
- GITHUB_ISSUE_URL
Public Class Methods
const_missing(constant_name)
click to toggle source
Calls superclass method
# File lib/restforce/error_code.rb, line 662 def self.const_missing(constant_name) warn "[restforce] You're referring to a Restforce error that isn't defined, " \ "`#{name}::#{constant_name}` (for example by trying to `rescue` it). This " \ "might be our fault - we've recently made some changes to how errors are " \ "defined. If you're sure that this is a valid Salesforce error, then " \ "please create an issue on GitHub at <#{GITHUB_ISSUE_URL}>." super end
get_exception_class(error_code)
click to toggle source
# File lib/restforce/error_code.rb, line 649 def self.get_exception_class(error_code) ERROR_EXCEPTION_CLASSES.fetch(error_code) do |_| warn "[restforce] An unrecognised error code, `#{error_code}` has been " \ "received from Salesforce. Instead of raising an error-specific exception" \ ", we'll raise a generic `ResponseError`. Please report this missing " \ "error code on GitHub at <#{GITHUB_ISSUE_URL}>." # If we've received an unexpected error where we don't have a specific # class defined, we can return a generic ResponseError instead ResponseError end end