Module ipernity.exceptions¶
Exceptions¶
Exception hierarchy:
digraph inheritancef5008df234 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "APIRequestError" [URL="#ipernity.exceptions.APIRequestError",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An API request did not succeed."]; "IpernityError" -> "APIRequestError" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IpernityError" [URL="#ipernity.exceptions.IpernityError",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for Ipernity exceptions."]; "UnknownMethod" [URL="#ipernity.exceptions.UnknownMethod",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An unknown method was called."]; "IpernityError" -> "UnknownMethod" [arrowsize=0.5,style="setlinewidth(0.5)"]; "UploadError" [URL="#ipernity.exceptions.UploadError",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip=":iper:`upload.checkTickets` returned invalid ticket data during upload."]; "IpernityError" -> "UploadError" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- exception ipernity.exceptions.IpernityError[source]¶
Bases:
ExceptionBase class for Ipernity exceptions.
Changed in version 0.2.0: IpernityError is the the parent of several specialized exceptions. The Ipernity-specific attributes were moved to
APIRequestError.- property message: str¶
Contains the error message.
- exception ipernity.exceptions.UnknownMethod(method: str | None = None, message: str | None = None)[source]¶
Bases:
IpernityErrorAn unknown method was called.
Added in version 0.2.0.
- property method: str¶
The method that was called.
- exception ipernity.exceptions.APIRequestError(status: str = 'error', code: int = 0, message: str = 'Unspecified Error', method: str | None = None, params: Mapping | None = None)[source]¶
Bases:
IpernityErrorAn API request did not succeed.
Added in version 0.2.0.
- property status: str¶
Result status of the request.
The value
'httperror'indicates that the HTTP request to the API failed. Otherwise, this attribute contains the status returned by Ipernity.
- property code: str | int¶
Error code.
If
statusis'httperror', this attribute contains the HTTP result code. Otherwise, it is the error code returned by Ipernity.
- property message: str¶
Error message returned by Ipernity, or generic message for HTTP errors.
- property method: str¶
Method that was called.
- property params: dict[str, str | int]¶
Parameters with that the method was called.
Warning
This may contain confidential information like
access_token!
- exception ipernity.exceptions.UploadError(filename: str | None = None, ticket: str | None = None, message: str | None = None)[source]¶
Bases:
IpernityError[upload.checkTickets] returned invalid ticket data during upload.
Added in version 0.2.0.
- property filename: str¶
File that was being uploaded.
- property ticket: str¶
Ipernity’s upload ticket.