Improved error handling in JExtract JNI mode #928
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.71) × (1 − Review Confidence (0.88)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 706 lines diff across 23 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.92 · 5 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.393
Mass File Touch
mass_file_touch
0.080
Real PR Conversation Timeline
6 items
extending `org.swift.swiftkit.core.SwiftJavaErrorException`, which is a `java.lang.Exception`.
no?
SwiftError is correct, that is the abstract class that all the errors extend. SwiftJavaErrorException (which I am renaming to AnySwiftError) is a concrete class, that is thrown when we cannot extract the concrete Error type.
If they are exceptions they should end with Exception please; so ...ErrorException etc, in order to not confuse Java users - they expect to only catch things ending with ...Exception, it's be weird to catch things that are not "exception" named
Makes sense. The rename was to not clash with FFM's SwiftJavaErrorException.
How about SwiftErrorException?
Yeah that sounds good
ktoso
madsodgaard
Fixes #826
Currently, the only way to handle specific errors in the JExtract JNI mode, is to do a string "contains" against the
Exceptionmessage. This is quite flakey, and not a nice experience for Java developers.This PR makes extracted
Errortypes extendExceptionitself, which means Java developers can catch Swift errors as normal Java exceptions. For typed throws we also explicitly can state that the Java method throws a specific exception.Also introduces a
AnySwiftError, which is thrown when we cannot extract a concrete userErrortype.