Skip to content

Commit 0415450

Browse files
committed
Log spans details in case of errors in toHTML method calls.
There are 2 distinct errors happening there, and we need to track spans for both of them.
1 parent 2178541 commit 0415450

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,14 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
11211121
val output: SpannableStringBuilder
11221122
try {
11231123
output = SpannableStringBuilder(text)
1124-
} catch (e: java.lang.ArrayIndexOutOfBoundsException) {
1124+
} catch (e: Exception) {
11251125
// FIXME: Remove this log once we've data to replicate the issue, and fix it in some way.
1126-
AppLog.e(AppLog.T.EDITOR, "There was an error creating SpannableStringBuilder. See #452 for details.")
1127-
// No need to log the exception here. The ExceptionHandler does this for us.
1126+
AppLog.e(AppLog.T.EDITOR, "There was an error creating SpannableStringBuilder. See #452 and #582 for details.")
1127+
when (e) {
1128+
is java.lang.ArrayIndexOutOfBoundsException, is java.lang.RuntimeException -> {
1129+
AztecLog.logContentDetails(this)
1130+
}
1131+
}
11281132
throw e
11291133
}
11301134

0 commit comments

Comments
 (0)