Report Exceptions
Call a single line API to report exceptions.
Any exceptions that may have already been caught using try-catch blocks needs to be reported as they might prevent the application from crashing, but can make app unstable if gone unreported.
Add to any try-catch block:
- Java
- Kotlin
try {
JSONObject jsonObject = new JSONObject(receivedString);
String id = jsonObject.getString("userID");
} catch (JSONException exception) {
Fn.setActivityMarker(this, receivedString); //Optional
Fn.reportException(this, exception, Severity.MAJOR);
}
try {
val jsonObject = JSONObject(receivedString)
val identifier = jsonObject.getString("userID")
} catch (JSONException exception) {
Fn.setActivityMarker(this@ParserClass, receivedString) //Optional
Fn.reportException(this@ParserClass, exception, Severity.MAJOR)
}