sanmar_sdk.exceptions ===================== .. py:module:: sanmar_sdk.exceptions .. autoapi-nested-parse:: Exceptions raised by the SanMar SDK. Every error the SDK raises on purpose is a :class:`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 ---------- .. autoapisummary:: sanmar_sdk.exceptions.SanMarError sanmar_sdk.exceptions.SanMarConnectionError sanmar_sdk.exceptions.SoapFaultError sanmar_sdk.exceptions.ResponseError sanmar_sdk.exceptions.ServiceError sanmar_sdk.exceptions.AuthenticationError sanmar_sdk.exceptions.AuthorizationError sanmar_sdk.exceptions.NotFoundError sanmar_sdk.exceptions.RequestError sanmar_sdk.exceptions.FileFormatError Module Contents --------------- .. py:exception:: SanMarError Bases: :py:obj:`Exception` Base class for every error the SDK raises. .. py:exception:: SanMarConnectionError Bases: :py:obj:`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. .. py:exception:: SoapFaultError(message: str, code: str | None = None) Bases: :py:obj:`SanMarError` SanMar answered with a SOAP fault. .. py:attribute:: message .. py:attribute:: code :value: None .. py:exception:: ResponseError Bases: :py:obj:`SanMarError` SanMar's response could not be parsed, or did not match its own WSDL. .. py:exception:: ServiceError(message: str, code: int | None = None) Bases: :py:obj:`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. .. py:attribute:: message .. py:attribute:: code :value: None .. py:exception:: AuthenticationError(message: str, code: int | None = None) Bases: :py:obj:`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. .. py:exception:: AuthorizationError(message: str, code: int | None = None) Bases: :py:obj:`ServiceError` The account is not authorized to use this service (PromoStandards code 104). .. py:exception:: NotFoundError(message: str, code: int | None = None) Bases: :py:obj:`ServiceError` SanMar has no record matching the request. .. py:exception:: RequestError(message: str, code: int | None = None) Bases: :py:obj:`ServiceError` SanMar rejected the request as malformed or out of range. .. py:exception:: FileFormatError(message: str, line_number: int | None = None) Bases: :py:obj:`SanMarError` A SanMar data file did not have the layout the SDK expects. .. py:attribute:: message .. py:attribute:: line_number :value: None