File tree 1 file changed +9
-5
lines changed
impl/src/main/saker/java/compiler/impl/compile/handler 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -527,12 +527,16 @@ public static SakerPath uriToFilePath(URI uri) {
527
527
String scheme = uri .getScheme ();
528
528
switch (scheme ) {
529
529
case "jar" : {
530
- String specific = uri .getSchemeSpecificPart ();
531
- if (specific .startsWith ("file:/" )) {
532
- int idx = specific .indexOf ('!' );
533
- return SakerPath .valueOf (specific .substring (6 , idx ));
530
+ try {
531
+ String specific = uri .getSchemeSpecificPart ();
532
+ if (specific .startsWith ("file:///" )) {
533
+ int idx = specific .indexOf ('!' );
534
+ return SakerPath .valueOf (specific .substring (8 , idx ));
535
+ }
536
+ } catch (Exception e ) {
537
+ throw new IllegalArgumentException ("Failed to convert URI to path: " + uri , e );
534
538
}
535
- throw new RuntimeException ( "Unknown jar protocol : " + specific );
539
+ throw new IllegalArgumentException ( "Failed to convert URI to path : " + uri );
536
540
}
537
541
case CompilationHandler .URI_SCHEME_GENERATED :
538
542
case CompilationHandler .URI_SCHEME_INPUT : {
You can’t perform that action at this time.
0 commit comments