mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8253660: Need better error report when artifact resolution fails in AotCompiler.java
Reviewed-by: ihse
This commit is contained in:
parent
52cb3292ae
commit
0b5101658d
3 changed files with 14 additions and 1 deletions
|
@ -268,6 +268,7 @@ public class AotCompiler {
|
||||||
}
|
}
|
||||||
} catch (ArtifactResolverException e) {
|
} catch (ArtifactResolverException e) {
|
||||||
System.err.println("artifact resolution error: " + e);
|
System.err.println("artifact resolution error: " + e);
|
||||||
|
e.printStackTrace(System.err);
|
||||||
// let jaotc try to find linker
|
// let jaotc try to find linker
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -853,7 +853,7 @@ public abstract class PKCS11Test {
|
||||||
+ "please check if JIB jar is present in classpath.");
|
+ "please check if JIB jar is present in classpath.");
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Fetch artifact failed: " + clazz
|
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
|
Policy.setPolicy(null); // Clear the policy created by JIB if any
|
||||||
|
|
|
@ -12,4 +12,16 @@ public class ArtifactResolverException extends Exception {
|
||||||
public ArtifactResolverException(String message, Throwable cause) {
|
public ArtifactResolverException(String message, Throwable cause) {
|
||||||
super(message, 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue