I have an app which includes a text box where the user can edit text which is subsequently displayed as scrolling text.
To ensure the app does not crash if the user uses text tags incorrectly, I have used a Try/Catch:
Sub btnTestText_Click
Try
lblScroll.Text = txtBBCode.Text
Catch
Log(LastException)
msgBox.Show("Check your text tags", "Error")
End Try
End Sub
If I purposely delete a tag when I run the code in the IDE, in the logs I see:
Error (position - 47): Closing tag does not match: b
(RuntimeException) java.lang.RuntimeException: Object should first be initialized (List).
Rather than just show "Check your text tags" in the message box, I would like to enhance feedback to the user by replacing "Check your text tags" with
"Error (position - 47): Closing tag does not match: b", but how do I capture that error text, which I presume comes from the BCTextEngine?