sanmar_sdk.exceptions

Exceptions raised by the SanMar SDK.

Every error the SDK raises on purpose is a SanMarError, so one except clause is enough to catch anything SanMar or the network did. Each is raised from the underlying zeep, requests, or paramiko error, which stays available as __cause__.

Exceptions

SanMarError

Base class for every error the SDK raises.

SanMarConnectionError

SanMar could not be reached, or answered with an HTTP error status.

SoapFaultError

SanMar answered with a SOAP fault.

ResponseError

SanMar's response could not be parsed, or did not match its own WSDL.

ServiceError

SanMar reported an error for the request.

AuthenticationError

SanMar rejected the credentials.

AuthorizationError

The account is not authorized to use this service (PromoStandards code 104).

NotFoundError

SanMar has no record matching the request.

RequestError

SanMar rejected the request as malformed or out of range.

FileFormatError

A SanMar data file did not have the layout the SDK expects.

Module Contents

exception sanmar_sdk.exceptions.SanMarError[source]

Bases: Exception

Base class for every error the SDK raises.

exception sanmar_sdk.exceptions.SanMarConnectionError[source]

Bases: SanMarError

SanMar could not be reached, or answered with an HTTP error status.

SanMar’s web services listen on port 8080, which some networks block outright.

exception sanmar_sdk.exceptions.SoapFaultError(message: str, code: str | None = None)[source]

Bases: SanMarError

SanMar answered with a SOAP fault.

message[source]
code = None[source]
exception sanmar_sdk.exceptions.ResponseError[source]

Bases: SanMarError

SanMar’s response could not be parsed, or did not match its own WSDL.

exception sanmar_sdk.exceptions.ServiceError(message: str, code: int | None = None)[source]

Bases: SanMarError

SanMar reported an error for the request.

code is the PromoStandards error code. SanMar’s own services report a message without a code, so it is None for them.

message[source]
code = None[source]
exception sanmar_sdk.exceptions.AuthenticationError(message: str, code: int | None = None)[source]

Bases: ServiceError

SanMar rejected the credentials.

Web services use a SanMar.com username and password (plus the customer number for SanMar’s own services). EDEV has separate credentials from production, and the SFTP server has its own password.

exception sanmar_sdk.exceptions.AuthorizationError(message: str, code: int | None = None)[source]

Bases: ServiceError

The account is not authorized to use this service (PromoStandards code 104).

exception sanmar_sdk.exceptions.NotFoundError(message: str, code: int | None = None)[source]

Bases: ServiceError

SanMar has no record matching the request.

exception sanmar_sdk.exceptions.RequestError(message: str, code: int | None = None)[source]

Bases: ServiceError

SanMar rejected the request as malformed or out of range.

exception sanmar_sdk.exceptions.FileFormatError(message: str, line_number: int | None = None)[source]

Bases: SanMarError

A SanMar data file did not have the layout the SDK expects.

message[source]
line_number = None[source]