Ir al contenido

Errors

Esta página aún no está disponible en tu idioma.

Classtryyoursize

Every exception is a TryYourSizeError. API answers raise an APIError subclass by status: InvalidRequestError (400, 422; issues for garments), AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), RateLimitError (429, retry_after), ServerError (5xx). APIConnectionError when no answer came; SignatureVerificationError for webhooks.

class APIError(TryYourSizeError)
statusintObligatorio

The HTTP status.

codeOptional[str]Obligatorio

The stable error code (API error codes).

doc_urlOptional[str]Obligatorio

Link to the code's explanation.

request_idOptional[str]Obligatorio

Quote it to support.

bodyDict[str, Any]Obligatorio

The parsed error body.

issueslistObligatorio

Garment issues of a 422; empty otherwise.

try:
tys.products.retrieve("NO-SUCH-SKU")
except tryyoursize.NotFoundError:
pass
except tryyoursize.APIError as err:
print(err.status, err.code, err.request_id)

¿Te ha resultado útil esta página?