Where do python errors go? (Serial Monitor custom filter)

I have been struggling with developing some custom filters for Serial Monitor, and it seems that runtime errors in python code are silently hidden, so there is no way to discern the difference between your embedded firmware crashing and the filter having any kind of error.

As an example of one kind of error, I can load python3 REPL and try to compare a number with a string:

>>> print(0 < '1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'str'

The TypeError is shown in the REPL.
However, if I put the same line of code at the beginning of my def rx(self, text): and try to run filter in Serial Monitor, there is no indication of an error, the Serial Monitor just stops printing anything.

This makes it very difficult to debug custom filters.