Exceptions#

Exception Classes#

Module:

salespyforce.errors.exceptions

Synopsis:

Collection of exception classes relating to the SalesPyForce library

Created By:

Jeff Shurtliff

Last Modified:

Jeff Shurtliff

Modified Date:

27 Feb 2026

exception salespyforce.errors.exceptions.APIConnectionError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when the API query could not be completed due to connection aborts and/or timeouts.

exception salespyforce.errors.exceptions.APIRequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic API request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.CurrentlyUnsupportedError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a feature or functionality being used is currently unsupported.

exception salespyforce.errors.exceptions.DELETERequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic DELETE request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.DataMismatchError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when there is a mismatch between two data sources.

exception salespyforce.errors.exceptions.FeatureNotConfiguredError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an API request fails because a feature is not configured.

exception salespyforce.errors.exceptions.GETRequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic GET request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.HelperFunctionNotFoundError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a function referenced in the helper config file does not exist.

exception salespyforce.errors.exceptions.InvalidEndpointError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid API endpoint / service is provided.

exception salespyforce.errors.exceptions.InvalidFieldError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid field is provided.

exception salespyforce.errors.exceptions.InvalidHelperArgumentsError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when the helper function was supplied arguments instead of keyword arguments.

exception salespyforce.errors.exceptions.InvalidHelperFileTypeError(*args, **kwargs)[source]#

Bases: SalesPyForceError, ValueError

This exception is used when an invalid file type is provided for the helper file.

exception salespyforce.errors.exceptions.InvalidLookupTypeError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid API lookup type is provided.

exception salespyforce.errors.exceptions.InvalidParameterError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid parameter is provided.

exception salespyforce.errors.exceptions.InvalidPayloadValueError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid value is provided for a payload field.

exception salespyforce.errors.exceptions.InvalidRequestTypeError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an invalid API request type is provided.

exception salespyforce.errors.exceptions.InvalidURLError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a provided URL is invalid.

exception salespyforce.errors.exceptions.LookupMismatchError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a lookup value doesn’t match the supplied lookup type.

exception salespyforce.errors.exceptions.MissingRequiredDataError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a function or method is missing one or more required arguments.

exception salespyforce.errors.exceptions.NotFoundResponseError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when an API query returns a 404 response and there is not a more specific class.

exception salespyforce.errors.exceptions.PATCHRequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic PATCH request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.POSTRequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic POST request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.PUTRequestError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used for generic PUT request errors when there is not a more specific exception.

exception salespyforce.errors.exceptions.PayloadMismatchError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when more than one payload is supplied for an API request.

exception salespyforce.errors.exceptions.SalesPyForceError[source]#

Bases: Exception

This is the base class for SalesPyForce exceptions.

exception salespyforce.errors.exceptions.UnknownFileTypeError(*args, **kwargs)[source]#

Bases: SalesPyForceError

This exception is used when a file type for a given file cannot be identified.

Handlers#

Module:

salespyforce.errors.handlers

Synopsis:

Functions that handle various error situations within the namespace

Created By:

Jeff Shurtliff

Last Modified:

Jeff Shurtliff

Modified Date:

26 Feb 2026

salespyforce.errors.handlers.display_warning(message: str, *, category: type[Warning] = <class 'UserWarning'>, stacklevel: int = 2) None[source]#

This function emits a warning that points to the caller by default.

Added in version 1.4.0.

Parameters:
  • message (str) – Warning message to emit

  • category (type[Warning]) – Warning category class (default: UserWarning)

  • stacklevel (int) – How far up the call stack to attribute the warning (2 by default - caller of this helper)

Returns:

None

salespyforce.errors.handlers.eprint(*args, **kwargs) None[source]#

This function behaves the same as the print() function but is leveraged to print errors to sys.stderr.

salespyforce.errors.handlers.get_exception_type(exc) str[source]#

This function returns the exception type (e.g. RuntimeError, TypeError, etc.) for a given exception.

Added in version 1.4.0.

Returns:

The exception type as a string