Right now, if I try to fetch an object that doesn't exist, I get this:
"Access Error : Device reports a undefined object."
Which relies heavily on the string.
It would be sweet to receive a custom exception called UndefinedObjectException which contains the message and perhaps the OBIS code of the object that I tried to access.
// Miro
Add specific exception classes for DLMS related errors
Hi,
You don't need to use strings. You can get the reason from the ErrorCode property.
OBIS code is not included in the error message and for this reason, it's not possible to add to the error.
The reason why there are not own error for each error code is that some meters are using their own custom errors.
Adding own error type for each of those errors is breaking the backward compatibility in some older projects and for this reason, we can't add it at the moment.
BR,
Mikko
Ok!
I see. I didn't know about the ErrorCode, I'll check that out!
// Miro