本文整理了Java中hudson.Util.getWin32ErrorMessage()
方法的一些代码示例,展示了Util.getWin32ErrorMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getWin32ErrorMessage()
方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:getWin32ErrorMessage
[英]Gets a human readable message for the given Win32 error code.
[中]获取给定Win32错误代码的可读消息。
代码示例来源:origin: jenkinsci/jenkins
public JnaException(int errorCode) {
super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
this.errorCode = errorCode;
}
代码示例来源:origin: jenkinsci/jenkins
public static String getWin32ErrorMessage(IOException e) {
return Util.getWin32ErrorMessage(e);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public String getMessage() {
return super.getMessage()+" error="+errorCode+":"+ Util.getWin32ErrorMessage(errorCode);
}
代码示例来源:origin: jenkinsci/jenkins
@CheckForNull
public static String getWin32ErrorMessage(@Nonnull IOException e) {
return getWin32ErrorMessage((Throwable)e);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* On Windows, error messages for IOException aren't very helpful.
* This method generates additional user-friendly error message to the listener
*/
public static void displayIOException(@Nonnull IOException e, @Nonnull TaskListener listener ) {
String msg = getWin32ErrorMessage(e);
if(msg!=null)
listener.getLogger().println(msg);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Extracts the Win32 error message from {@link Throwable} if possible.
*
* @return
* null if there seems to be no error code or if the platform is not Win32.
*/
@CheckForNull
public static String getWin32ErrorMessage(Throwable e) {
String msg = e.getMessage();
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 ignored) {
// silently recover from resource related failures
}
}
}
if(e.getCause()!=null)
return getWin32ErrorMessage(e.getCause());
return null; // no message
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public JnaException(int errorCode) {
super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
this.errorCode = errorCode;
}
代码示例来源:origin: org.hudsonci.plugins/jna-native-support-plugin
public JnaException(int errorCode) {
super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
this.errorCode = errorCode;
}
代码示例来源:origin: hudson/hudson-2.x
public JnaException(int errorCode) {
super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
this.errorCode = errorCode;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public JnaException(int errorCode) {
super("Win32 error: "+errorCode+" - "+Util.getWin32ErrorMessage(errorCode));
this.errorCode = errorCode;
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public static String getWin32ErrorMessage(IOException e) {
return Util.getWin32ErrorMessage(e);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public static String getWin32ErrorMessage(IOException e) {
return Util.getWin32ErrorMessage(e);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public static String getWin32ErrorMessage(IOException e) {
return getWin32ErrorMessage((Throwable) e);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public String getMessage() {
return super.getMessage()+" error="+errorCode+":"+ Util.getWin32ErrorMessage(errorCode);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* On Windows, error messages for IOException aren't very helpful.
* This method generates additional user-friendly error message to the listener
*/
public static void displayIOException( IOException e, TaskListener listener ) {
String msg = getWin32ErrorMessage(e);
if(msg!=null)
listener.getLogger().println(msg);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* On Windows, error messages for IOException aren't very helpful. This
* method generates additional user-friendly error message to the listener
*/
public static void displayIOException(IOException e, TaskListener listener) {
String msg = getWin32ErrorMessage(e);
if (msg != null) {
listener.getLogger().println(msg);
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* On Windows, error messages for IOException aren't very helpful.
* This method generates additional user-friendly error message to the listener
*/
public static void displayIOException(IOException e, TaskListener listener) {
String msg = getWin32ErrorMessage(e);
if (msg != null) {
listener.getLogger().println(msg);
}
}
代码示例来源:origin: hudson/hudson-2.x
/**
* On Windows, error messages for IOException aren't very helpful.
* This method generates additional user-friendly error message to the listener
*/
public static void displayIOException( IOException e, TaskListener listener ) {
String msg = getWin32ErrorMessage(e);
if(msg!=null)
listener.getLogger().println(msg);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@CheckForNull
public static String getWin32ErrorMessage(@Nonnull IOException e) {
return getWin32ErrorMessage((Throwable)e);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* On Windows, error messages for IOException aren't very helpful.
* This method generates additional user-friendly error message to the listener
*/
public static void displayIOException(@Nonnull IOException e, @Nonnull TaskListener listener ) {
String msg = getWin32ErrorMessage(e);
if(msg!=null)
listener.getLogger().println(msg);
}
内容来源于网络,如有侵权,请联系作者删除!