Skip to content

Commit c8dbb17

Browse files
committed
In case of crashes, report the HTML code, and the full spans details, available in the AztecText. Do not report exceptions that can occur logging the content.
1 parent 0415450 commit c8dbb17

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecExceptionHandler.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,20 @@ class AztecExceptionHandler(private val logHelper: ExceptionHandlerHelper?, priv
2424
try {
2525
shouldLog = logHelper?.shouldLog(ex) ?: true
2626
} catch (e: Throwable) {
27-
AppLog.w(AppLog.T.EDITOR, "There was an exception in the Logger Helper. Set the logging to true" )
27+
AppLog.w(AppLog.T.EDITOR, "There was an exception in the Logger Helper. Set the logging to true")
2828
}
2929

3030
if (shouldLog) {
31-
// Try to report the HTML code of the content, but do not report exceptions that can occur logging the content
31+
// Try to report the HTML code of the content, the spans details, but do not report exceptions that can occur logging the content
3232
try {
3333
AppLog.e(AppLog.T.EDITOR, "HTML Content of Aztec Editor before the crash " + visualEditor.toPlainHtml(false))
3434
} catch (e: Throwable) {
35-
AppLog.e(AppLog.T.EDITOR, "HTML Content of Aztec Editor before the crash is unavailable, log the details instead")
35+
// nope
36+
}
37+
try {
3638
AztecLog.logContentDetails(visualEditor)
39+
} catch (e: Throwable) {
40+
// nope
3741
}
3842
}
3943

0 commit comments

Comments
 (0)