Skip to content

Commit

Permalink
8253660: Need better error report when artifact resolution fails in A…
Browse files Browse the repository at this point in the history
…otCompiler.java

Reviewed-by: ihse
  • Loading branch information
erikj79 committed Oct 19, 2020
1 parent 52cb329 commit 0b51016
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/hotspot/jtreg/compiler/aot/AotCompiler.java
Expand Up @@ -268,6 +268,7 @@ class DevkitLinuxX64 { }
}
} catch (ArtifactResolverException e) {
System.err.println("artifact resolution error: " + e);
e.printStackTrace(System.err);
// let jaotc try to find linker
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/sun/security/pkcs11/PKCS11Test.java
Expand Up @@ -853,7 +853,7 @@ private static String fetchNssLib(Class<?> clazz) {
+ "please check if JIB jar is present in classpath.");
} else {
throw new RuntimeException("Fetch artifact failed: " + clazz
+ "\nPlease make sure the artifact is available.");
+ "\nPlease make sure the artifact is available.", e);
}
}
Policy.setPolicy(null); // Clear the policy created by JIB if any
Expand Down
12 changes: 12 additions & 0 deletions test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java
Expand Up @@ -12,4 +12,16 @@ public ArtifactResolverException(String message) {
public ArtifactResolverException(String message, Throwable cause) {
super(message, cause);
}

public String toString() {
return super.toString() + ": " + getRootCause().toString();
}

public Throwable getRootCause() {
Throwable rootCause = getCause();
while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
rootCause = rootCause.getCause();
}
return rootCause;
}
}

1 comment on commit 0b51016

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 0b51016 Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.