提交 af60f2b1 编写于 作者: K kohsuke

improved error diagnosis. the logic that looks into the chained exceptions were wrong.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3629 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1600bd2f
......@@ -213,22 +213,21 @@ public class Util {
*/
public static String getWin32ErrorMessage(Throwable e) {
String msg = e.getMessage();
if(msg==null) {
if(e.getCause()!=null)
return getWin32ErrorMessage(e.getCause());
return null; // no message
if(msg!=null) {
Matcher m = errorCodeParser.matcher(msg);
if(m.matches()) {
try {
ResourceBundle rb = ResourceBundle.getBundle("/hudson/win32errors");
return rb.getString("error"+m.group(1));
} catch (Exception _) {
// silently recover from resource related failures
}
}
}
Matcher m = errorCodeParser.matcher(msg);
if(!m.matches())
return null; // failed to parse
try {
ResourceBundle rb = ResourceBundle.getBundle("/hudson/win32errors");
return rb.getString("error"+m.group(1));
} catch (Exception _) {
// silently recover from resource related failures
return null;
}
if(e.getCause()!=null)
return getWin32ErrorMessage(e.getCause());
return null; // no message
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册