提交 56697de4 编写于 作者: K kohsuke

[HUDSON-6992] a failure to locate the error resources shouldn't cause a fatal problem.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@36130 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9f7718ad
......@@ -80,6 +80,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.SimpleTimeZone;
import java.util.StringTokenizer;
......@@ -396,8 +397,13 @@ public class Util {
* null if no such message is available.
*/
public static String getWin32ErrorMessage(int n) {
ResourceBundle rb = ResourceBundle.getBundle("/hudson/win32errors");
return rb.getString("error"+n);
try {
ResourceBundle rb = ResourceBundle.getBundle("/hudson/win32errors");
return rb.getString("error"+n);
} catch (MissingResourceException e) {
LOGGER.log(Level.WARNING,"Failed to find resource bundle",e);
return null;
}
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册