Skip to content

Commit 0b51016

Browse files
committed
8253660: Need better error report when artifact resolution fails in AotCompiler.java
Reviewed-by: ihse
1 parent 52cb329 commit 0b51016

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

test/hotspot/jtreg/compiler/aot/AotCompiler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ class DevkitLinuxX64 { }
268268
}
269269
} catch (ArtifactResolverException e) {
270270
System.err.println("artifact resolution error: " + e);
271+
e.printStackTrace(System.err);
271272
// let jaotc try to find linker
272273
return null;
273274
}

test/jdk/sun/security/pkcs11/PKCS11Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ private static String fetchNssLib(Class<?> clazz) {
853853
+ "please check if JIB jar is present in classpath.");
854854
} else {
855855
throw new RuntimeException("Fetch artifact failed: " + clazz
856-
+ "\nPlease make sure the artifact is available.");
856+
+ "\nPlease make sure the artifact is available.", e);
857857
}
858858
}
859859
Policy.setPolicy(null); // Clear the policy created by JIB if any

test/lib/jdk/test/lib/artifacts/ArtifactResolverException.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ public ArtifactResolverException(String message) {
1212
public ArtifactResolverException(String message, Throwable cause) {
1313
super(message, cause);
1414
}
15+
16+
public String toString() {
17+
return super.toString() + ": " + getRootCause().toString();
18+
}
19+
20+
public Throwable getRootCause() {
21+
Throwable rootCause = getCause();
22+
while (rootCause.getCause() != null && rootCause.getCause() != rootCause) {
23+
rootCause = rootCause.getCause();
24+
}
25+
return rootCause;
26+
}
1527
}

0 commit comments

Comments
 (0)