MindSphere SDK for Python - Error Handling¶
Understanding how and when the MindSphere SDK for Python throws errors is important to build high-quality applications using the SDK. The following sections describe the different scenarios in which errors are thrown by the SDK and how to handle them appropriately.
MindsphereError is the most common error that you'll experience when using the MindSphere SDK for Python. This error represents an error response from a MindSphere service.
MindsphereError provides you with information such as:
- Returned HTTP status
- Returned error details
- Detailed error message from the service
- Reference to the occurred error
Structure of MindsphereError¶
| ||Error message|
| ||Error code (if returned by API)|
| ||HTTP status|
| ||Logger reference (if returned by API)|
Subclasses of MindsphereError¶
|MindsphereServerError||MindsphereError||Indicates an error at the API endpoint. For example, if user tries to call an API with invalid values for mandatory parameters.|
|MindsphereClientError||MindsphereError||Indicates an error due to missing parameter values in a request. For example, if user tries to call an API with NULL values for mandatory parameters.|
|MindsphereClientConfigurationError||MindsphereClientError||Indicates an error due to incorrect configuration parameters. For example, if a developer sets an incorrect value for the proxy or proxy port.|
|MindsphereForbiddenAccessError||MindsphereClientError||Indicates that no valid token can be retrieved with the provided credentials.|
Any questions left?
Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.