Closed chrisseaton closed 3 years ago
Removing the Java stacktrace can be problematic for debugging though.
I think ideally we would have a checked exception variant that does not capture a stacktrace, and then some of the JCodings methods could have a variant throwing that checked exception instead, like Encoding#codeToMbcLength()
.
Actually Encoding#codeToMbcLength()
seems to never throw an exception, so the caller code was probably too defensive.
I think we can close, besides that one case where it's not needed, TruffleRuby does not catch any JCodings exception (git grep -F org.jcodings.exception
).
Ok apologies for the noise I'll dig a bit further as I thought this was the performance issue.
We know that encoding exceptions occur in the fast path, https://github.com/jruby/jruby/issues/6652, so should we disable the Java stack trace in JCodings exceptions?
https://github.com/jruby/jcodings/blob/master/src/org/jcodings/exception/JCodingsException.java
@eregon