提交 86b921ec 编写于 作者: K kohsuke

Improved the error diagnosis, after seeing...

Improved the error diagnosis, after seeing http://www.nabble.com/error-installing-hudson-as-a-windows-service-tt21378003.html

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14315 71c3de6d-444a-0410-be80-ed276b4c234a
上级 4b2f0f14
...@@ -323,6 +323,17 @@ public class Util { ...@@ -323,6 +323,17 @@ public class Util {
return null; // no message return null; // no message
} }
/**
* Gets a human readable mesasge for the given Win32 error code.
*
* @return
* null if no such message is available.
*/
public static String getWin32ErrorMessage(int n) {
ResourceBundle rb = ResourceBundle.getBundle("/hudson/win32errors");
return rb.getString("error"+n);
}
/** /**
* Guesses the current host name. * Guesses the current host name.
*/ */
......
package hudson.util.jna; package hudson.util.jna;
import hudson.Util;
/** /**
* Exception in the registry code. * Exception in the registry code.
* *
...@@ -7,6 +9,6 @@ package hudson.util.jna; ...@@ -7,6 +9,6 @@ package hudson.util.jna;
*/ */
public class JnaException extends RuntimeException { public class JnaException extends RuntimeException {
public JnaException(int errorCode) { public JnaException(int errorCode) {
super("Win32 error: "+errorCode); super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册