RUMM-2797 SR RequestFactory allow to throw exceptions#1217
Conversation
3046306 to
c410c64
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/sdkv2 #1217 +/- ##
=================================================
- Coverage 82.72% 82.64% -0.09%
=================================================
Files 353 354 +1
Lines 12589 12572 -17
Branches 2086 2085 -1
=================================================
- Hits 10414 10389 -25
- Misses 1535 1542 +7
- Partials 640 641 +1
🚀 New features to boost your workflow:
|
0xnm
left a comment
There was a problem hiding this comment.
I left some comments, but overall ltgm.
| @Suppress("UnsafeThirdPartyFunctionCall") | ||
| body.writeTo(buffer) | ||
| @Suppress("UnsafeThirdPartyFunctionCall") | ||
| return buffer.readByteArray() |
There was a problem hiding this comment.
this readByteArray method is strange - it says that it can throw IOException, but the actual implementation actually can also throw Error:
try {
return readByteArray(size);
} catch (EOFException e) {
throw new AssertionError(e);
}
Do you think we should catch it? Because the outer code only handles exceptions, but not errors. Normally errors are not recoverable though, so maybe we don't need to.
There was a problem hiding this comment.
yeah...that's the thing...I would leave errors not caught ...it will be another thread anyway not the main thread.
|
|
||
| package com.datadog.android.sessionreplay.internal.exception | ||
|
|
||
| internal class InvalidPayloadFormatException(message: String) : Exception(message) |
There was a problem hiding this comment.
Let's make it extend RuntimeException, so that it is not checked one.
| internal class InvalidPayloadFormatException(message: String) : Exception(message) | |
| internal class InvalidPayloadFormatException(message: String) : RuntimeException(message) |
c410c64 to
06e0a88
Compare
What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)