本文整理汇总了Java中org.apache.olingo.odata2.api.commons.HttpStatusCodes.INTERNAL_SERVER_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java HttpStatusCodes.INTERNAL_SERVER_ERROR属性的具体用法?Java HttpStatusCodes.INTERNAL_SERVER_ERROR怎么用?Java HttpStatusCodes.INTERNAL_SERVER_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.olingo.odata2.api.commons.HttpStatusCodes
的用法示例。
在下文中一共展示了HttpStatusCodes.INTERNAL_SERVER_ERROR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleError
@Override
public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
if (context.getHttpStatus() == HttpStatusCodes.INTERNAL_SERVER_ERROR) {
LOG.error("Internal Server Error", context.getException());
}
return EntityProvider.writeErrorDocument(context);
}
示例2: handleError
public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
if (context.getHttpStatus() == HttpStatusCodes.INTERNAL_SERVER_ERROR) {
LOG.error("Internal Server Error", context.getException());
}
return EntityProvider.writeErrorDocument(context);
}
示例3: handleError
@Override
public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
if (context.getHttpStatus() == HttpStatusCodes.INTERNAL_SERVER_ERROR) {
LOG.error("Internal Server Error", context.getException());
}
return EntityProvider.writeErrorDocument(context);
}
示例4: testErrorCodeForApplicationException
@Test
public void testErrorCodeForApplicationException() throws Exception {
// prepare
String errorCode = "ErrorCode";
String message = "expected exception message";
Exception exception =
new ODataApplicationException(message, Locale.ENGLISH, HttpStatusCodes.INTERNAL_SERVER_ERROR, errorCode);
// execute
Response response = exceptionMapper.toResponse(exception);
// verify
String errorMessage = verifyResponse(response, message, HttpStatusCodes.INTERNAL_SERVER_ERROR);
assertXpathEvaluatesTo(errorCode, "/a:error/a:code", errorMessage);
}
示例5: ODataInternalServerErrorException
public ODataInternalServerErrorException(final MessageReference messageReference) {
super(messageReference, HttpStatusCodes.INTERNAL_SERVER_ERROR);
}