simple_salesforce.exceptions module

All exceptions for Simple Salesforce

exception simple_salesforce.exceptions.SalesforceAuthenticationFailed(code, message)

Bases: simple_salesforce.exceptions.SalesforceError

Thrown to indicate that authentication with Salesforce failed.

__init__(code, message)
exception simple_salesforce.exceptions.SalesforceError(url, status, resource_name, content)

Bases: exceptions.Exception

Base Salesforce API exception

__init__(url, status, resource_name, content)

Initialize the SalesforceError exception

SalesforceError is the base class of exceptions in simple-salesforce

Args:
url: Salesforce URL that was called status: Status code of the error response resource_name: Name of the Salesforce resource being queried content: content of the response
message = u'Unknown error occurred for {url}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceExpiredSession(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

Error Code: 401 The session ID or OAuth token used has expired or is invalid. The response body contains the message and errorCode.

message = u'Expired session for {url}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceGeneralError(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

A non-specific Salesforce error.

message = u'Error Code {status}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceMalformedRequest(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

Error Code: 400 The request couldn’t be understood, usually because the JSON or XML body contains an error.

message = u'Malformed request {url}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceMoreThanOneRecord(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

Error Code: 300 The value returned when an external ID exists in more than one record. The response body contains the list of matching records.

message = u'More than one record for {url}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceRefusedRequest(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

Error Code: 403 The request has been refused. Verify that the logged-in user has appropriate permissions.

message = u'Request refused for {url}. Response content: {content}'
exception simple_salesforce.exceptions.SalesforceResourceNotFound(url, status, resource_name, content)

Bases: simple_salesforce.exceptions.SalesforceError

Error Code: 404 The requested resource couldn’t be found. Check the URI for errors, and verify that there are no sharing issues.

message = u'Resource {name} Not Found. Response content: {content}'