mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
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:
1 parent
1600bd2fc0
commit
af60f2b190
1 file changed
+13
-14
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user