, is it possible to catch or suppress them without
try ... catch
block?
k
kingsley
10/11/2018, 1:21 PM
Consider taking advantage of
String#toIntOrNull
instead
kingsley
10/11/2018, 1:21 PM
Then you won’t have to deal with any exception/catching
v
ValV
10/11/2018, 3:58 PM
@kingsley thanks, for these days I've tried it. And finally stayed with setting custom
TextFormatter
(and overriding TFX functions, and writing custom
TableCell
) to prevent this exception ever happen. But I could not find how to push back those exceptions without user interaction. I.e. when such exception arises, and we see the call stack, exiting this exception dialog, program returns to the moment before the exception. So I supposed that it can be done automatically and silently
k
kingsley
10/11/2018, 4:17 PM
not sure I understand the dialog you’re describing
do you mean the app is crashing? in that case, try/catch will silence the crash.
However, you can just use the method I mentioned earlier, so you only have to check for
null
instead of catching exceptions which is much more expensive