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
This commit is contained in:
kohsuke committed 2007-07-10 00:42:41 +00:00
1 parent 1600bd2fc0
commit af60f2b190
1 file changed
+13 -14
+13 -14
View File
@@ -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
}
/**