The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Terms of Use and Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content
Insights Hub and Industrial IoT

Insights Hub drives smart manufacturing through the industrial Internet of Things. Gain actionable insights with asset and operational data and improve your processes.

Industrial IoT SDK for Java - Exception Handling¶

Understanding how and when the Industrial IoT SDK for Java throws exceptions is important to build high-quality applications using the SDK. The following sections describe the different scenarios in which exceptions are thrown by the SDK and how to handle them appropriately.

MindsphereException¶

MindsphereException is the most common exception that you'll experience when using the Industrial IoT SDK for Java. This exception represents an error response from an Industrial IoT service.

MindsphereException provides you with information such as:

  • Returned HTTP status
  • Returned HTTP status Code
  • Detailed error message from the service
  • Reference to the error occurred

Structure of MindsphereException¶

NameDescriptionType
errorStatusCodeError code (if returned by API)String
errorMessageError messageString
httpStatusHTTP statusHttpStatus
logrefLogger reference (if returned by API)String
causeCause of the exception (if any)Throwable

Subclasses of MindsphereException¶

MindsphereClientException is a subclass of MindsphereException. It is thrown when an error occurs due to user's fault (a request with missing values). For example, if user tries to call an API with null values for mandatory parameters then MindsphereClientException is thrown to indicate that required parameters are missing.

MindsphereServiceException is a subclass of MindsphereException. It is thrown when an error occurs at the API endpoint. For example, if user tries to call an API with invalid values for mandatory parameters. A MindsphereServiceException is thrown only when an error is encountered at the API endpoint.

MindsphereClientConfigurationException is a subclass of MindsphereClientException. It is thrown when incorrect configuration parameters are set. For example, if a developer uses an incorrect value for the proxy, MindsphereClientConfigurationException is thrown to indicate that incorrect proxy host or proxy port.

MindsphereForbiddenAccessException is a subclass of MindsphereClientException. It is thrown when valid token is not retrieved with the provided credentials.