本文整理了Java中java.lang.Error.getMessage()
方法的一些代码示例,展示了Error.getMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Error.getMessage()
方法的具体详情如下:
包路径:java.lang.Error
类名称:Error
方法名:getMessage
暂无
代码示例来源:origin: apache/rocketmq
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
* <p/>
* "Internal Error : Please file a bug report .... "
* <p/>
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: apache/zookeeper
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: apache/storm
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: wildfly/wildfly
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: wildfly/wildfly
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: commons-lang/commons-lang
/**
* Returns the detail message string of this throwable. If it was
* created with a null message, returns the following:
* (cause==null ? null : cause.toString()).
*
* @return String message string of the throwable
*/
public String getMessage() {
if (super.getMessage() != null) {
return super.getMessage();
} else if (cause != null) {
return cause.toString();
} else {
return null;
}
}
代码示例来源:origin: spockframework/spock
@Override
public String getMessage() {
return String.format(super.getMessage(), msgArgs);
}
}
代码示例来源:origin: vavr-io/vavr
@Override
public String toString() {
return String.format("%s(propertyName = %s, count = %s, error = %s, sample = %s)", getClass().getSimpleName(), propertyName, count, error.getMessage(), sample);
}
}
代码示例来源:origin: redisson/redisson
@Override
public String getMessage()
{
return String.format("[%s] %s", errorCode.name(), super.getMessage());
}
}
代码示例来源:origin: commons-lang/commons-lang
/**
* {@inheritDoc}
*/
public String getMessage(int index) {
if (index == 0) {
return super.getMessage();
}
return delegate.getMessage(index);
}
代码示例来源:origin: apache/storm
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
代码示例来源:origin: spring-projects/spring-framework
@ExceptionHandler
public void myPath2(Error err, HttpServletResponse response) throws IOException {
response.getWriter().write(err.getMessage());
}
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the text fully marked up by {@link ChangeLogAnnotator}.
*/
public String getMsgAnnotated() {
MarkupText markup = new MarkupText(getMsg());
for (ChangeLogAnnotator a : ChangeLogAnnotator.all())
try {
a.annotate(parent.run, this, markup);
} catch(Exception e) {
LOGGER.info("ChangeLogAnnotator " + a.toString() + " failed to annotate message '" + getMsg() + "'; " + e.getMessage());
} catch(Error e) {
LOGGER.severe("ChangeLogAnnotator " + a.toString() + " failed to annotate message '" + getMsg() + "'; " + e.getMessage());
}
return markup.toString(false);
}
代码示例来源:origin: uber/NullAway
public static void main(String arg[]) throws java.io.IOException {
String s = "test string...";
Foo f = new Foo("let's");
Bar b = new Bar("try");
try {
test(s, f, b);
} catch (Error e) {
System.out.println(e.getMessage());
}
}
}
代码示例来源:origin: spring-projects/spring-framework
@MessageExceptionHandler
public void handleErrorWithHandlerMethodArg(Error ex, HandlerMethod handlerMethod) {
this.method = "handleErrorWithHandlerMethodArg";
this.arguments.put("handlerMethod", handlerMethod);
assertEquals("my cause", ex.getMessage());
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void addToQueue_submits_runnable_that_fails_if_Runnable_argument_throws_Error() {
Error expected = new Error("Faking an exception thrown by Runnable argument");
Runnable runnable = () -> {
throw expected;
};
expectedException.expect(Error.class);
expectedException.expectMessage(expected.getMessage());
underTest.addToQueue(runnable);
}
}
内容来源于网络,如有侵权,请联系作者删除!