Detailed API reference for the wingpy.exceptions module, which provides custom exceptions used throughout wingpy for error handling.
We have defined several specific exceptions to help you identify and handle different error scenarios effectively in your automation scripts.
They include rich context about what went wrong, making debugging easier, and this also allows us to provide more meaningful logging messages.
def__str__(self)->str:msg=self.messageifself.response:code=self.response.status_codemsg+=f"\nAuthentication failed with status code: {code}"msg+=f"\nResponse content: {self.response.text}"returnmsg
def__str__(self)->str:""" Return a detailed error message including the full URL if possible. """msg=self.messageifisinstance(self.client,ApiClient):client_name=self.client.__class__.__name__msg+=f"\n{client_name}: Invalid endpoint path provided."ifisinstance(self.client,ApiClient)andself.endpoint_path:msg+=f"\nFull URL: {self.client.base_url}{self.endpoint_path}"else:ifisinstance(self.client,ApiClient):msg+=f"\nBase URL: {self.client.base_url}"ifself.endpoint_path:msg+=f"\nEndpoint path: {self.endpoint_path}"returnmsg
def__str__(self)->str:msg=self.messageifself.response:code=self.response.status_codemsg+=f"\nInvalid response with status code: {code}"msg+=f"\nResponse content: {self.response.text}"returnmsg
def__str__(self)->str:msg=self.messageifself.base_url:msg+=f"\nInvalid base URL: {self.base_url}"msg+="\nThe base URL must include a valid network location."returnmsg
def__str__(self)->str:msg=self.messageifself.base_url:msg+=f"\nInvalid base URL: {self.base_url}"msg+="\nThe base URL must start with 'http://' or 'https://'."returnmsg
def__str__(self)->str:msg=self.messageifisinstance(self.client,ApiClient):client_name=self.client.__class__.__name__else:client_name="this API"ifself.method:msg+=f"\n{self.method} not supported by {client_name}"returnmsg