We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a SEND containing a duplicates (same path + timestamp) is received, TimestampedLwM2mNodes.Builder::build throws an IllegalArgumentException.
if (noDuplicate && previous != null) { throw new IllegalArgumentException(String.format( "Unable to create TimestampedLwM2mNodes : duplicate value for path %s. (%s, %s)", internalNode.path, internalNode.node, previous)); }
That exception is just catched in SendResource::handlePOST, to be sent to the SendListener::onError callback and rethrown.
} catch (RuntimeException e) { sendHandler.onError(registration, e); throw e; }
Maybe it would be better to catch that exception (in LwM2mNodeSenMLDecoder::decodeTimestampedNodes) and rethrow as CodecException?
} catch (SenMLException | IllegalArgumentException e) { String hexValue = content != null ? Hex.encodeHexString(content) : ""; throw new CodecException(e, "Unable to decode nodes : %s", hexValue, e); }
The text was updated successfully, but these errors were encountered:
Yep totally agree ! Good catch 👍 !
Sorry, something went wrong.
I've made a commit on opl/rethrow_illegalArgumentException
Yep I think you can create a PR
GH-1376: Better to raise CodecException in LwM2mNodeSenMLDecoder.
6a1ff2d
Fix in master by #1377.
master
Thx @Warmek for catching this 😉 !
No branches or pull requests
Question
When a SEND containing a duplicates (same path + timestamp) is received, TimestampedLwM2mNodes.Builder::build throws an IllegalArgumentException.
That exception is just catched in SendResource::handlePOST, to be sent to the SendListener::onError callback and rethrown.
Maybe it would be better to catch that exception (in LwM2mNodeSenMLDecoder::decodeTimestampedNodes) and rethrow as CodecException?
The text was updated successfully, but these errors were encountered: