Skip to main content
Version: 1.0.2

Report Exceptions in Android with Appxiom SDK

Manual Reporting: Use the single-line API to report caught exceptions.

Type: 12 | Default Severity: Major

Appxiom SDK makes it easy to report exceptions that are caught in your app’s try-catch blocks, ensuring that even non-crashing errors are tracked and analyzed. This helps maintain application stability and provides visibility into issues that could otherwise go unnoticed.

Call a single line API to report exceptions.

Why Report Caught Exceptions?

Exceptions caught by try-catch blocks may prevent crashes, but if left unreported, they can lead to hidden bugs and unstable app behavior. Reporting these exceptions to Appxiom ensures you are aware of all critical issues and take action where necessary, not just crashes.

How to Report Exceptions

Add the following code to any try-catch block to report exceptions to Appxiom:

try {
JSONObject jsonObject = new JSONObject(receivedString);
String id = jsonObject.getString("userID");
} catch (JSONException exception) {
Ax.setActivityMarker(this, receivedString); // Optional: add context
Ax.reportException(this, exception, Severity.MAJOR);
}

Frequently Asked Questions (FAQs)

Q: Can I report exceptions that are not thrown but only caught?
A: Yes, Appxiom SDK is designed to capture and report exceptions that are caught in try-catch blocks, even if they do not crash the app.

Q: What information is sent to Appxiom when I use reportException()?
A: The SDK sends the exception type, message, stacktrace, and any optional context you provide (such as activity markers or custom data).

Q: How can I add more context to a reported exception?
A: Use Ax.setActivityMarker() to tag the exception with relevant activity or data, making RCA easier in the dashboard.

Q: Can I set different severity levels for different exceptions?
A: Yes, you can specify the severity (e.g., FATAL, MAJOR, MINOR) when calling Ax.reportException() (Check the code snippet above) to indicate the impact of the error.

Q: Will reporting exceptions affect my app’s performance?
A: Exception reporting is lightweight and optimized for production use, so it has minimal impact on app performance.

Q: How do I view reported exceptions?
A: All reported exceptions are available in the Appxiom dashboard, where you can filter and analyze them by type and severity.

Q: Is there a way to automate exception reporting for all try-catch blocks?
A: Currently, you need to manually call Ax.reportException() in each try-catch block where you want to track exceptions.