gpt4 book ai didi

java - Java打印InternalError实际错误

转载 作者:行者123 更新时间:2023-12-03 08:49:45 25 4
gpt4 key购买 nike

在代码中,我遇到了InternalError。我希望能够打印出实际错误。

但是,实际错误远远不在堆栈中。实际错误是
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 504 Gateway Timeout"

Exception in thread "Thread-13" java.lang.InternalError: Should not reach 
here
at java.net.HttpConnectSocketImpl.doTunneling(Unknown Source)
at java.net.HttpConnectSocketImpl.doTunnel(Unknown Source)
at java.net.HttpConnectSocketImpl.access$200(Unknown Source)
at java.net.HttpConnectSocketImpl$2.run(Unknown Source)
at java.net.HttpConnectSocketImpl$2.run(Unknown Source)

....

at checker.ui.panels.SystemCheckPanel.run(SystemCheckPanel.java:1058)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
... 15 more
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 504 Gateway Timeout"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
... 19 more'

我如何打印实际错误为504消息。

最佳答案

 try {
blah...
} catch (IOException e) {
Throwable cause = e.getCause();
System.out.println(cause.getMessage());
}

关于java - Java打印InternalError实际错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44034502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com