Skip to content

Exception/Error messages

Previously it was said that when an operation is successfully completed, the status of the channel switches to SUCCESS, while when the system fails to complete the request, the status goes to FAILURE. In the second case, the status of the channel will also allow access to an explanatory window of why the operation failed.

Below we give a brief description of the different messages that are provided along with the errors.

Reading error messages

  • NullPointerException (code: 1): when the user requests a resource not present on the server, a message will notify us of this error and provide a list of available resources;
  • IllegalArgumentException (code: 2): when the resource exists, but not an object associated with that index. Each resource can contain 1 or more objects, each associated with an index ranging from 1 to maximum 9. Also in this case the error message is accompanied by the number of objects available for the specific resource;
  • GXDLMSException (code: 3): when resource and object exist, but the data is asked in the form of a type not congruent with the original one. If, for example, the object is in the form of JSON with multiple fields, and you require a string, the system can accept this conversion; if instead you require the same resource but float type, the system will fail to cast and will return an error, indicating also what is the original type;
  • Exception (code: 99): generic error, not the type of the above. The system still tries to return an explanatory error message.

ReadError

Writing error messages

  • NullPointerException (code: 1): same as for the reading procedure;
  • IllegalArgumentException (code: 2): same as for the reading procedure;
  • GXDLMSException (code: 3): same as for the reading procedure;
  • ClassCastException (code: 4): similar to the previous error, but in this case we try to assign a value of a type not congruent to the one present in the server: if the user tries to write a string on a float object, we get this error;
  • JsonSyntaxException (code: 5): when you try to write a multiparameter object, then in the form of JSON with multiple fields, and do not enter in the fillable box the entire JSON. As explained above, when trying to write an object of this type, the user must pass all the JSON, modifying the values that you want to overwrite;
  • Exception (code: 99): same as for the reading procedure.

WriteError