Java 类com.mongodb.MongoServerException 实例源码

项目:sam    文件:MongoServerExceptionMapper.java   
@Override
public Response toResponse(MongoServerException exc) {

  logger.error("Got mongo server exception", exc);
  final Status errorCode = Status.INTERNAL_SERVER_ERROR;
  return Response.status(errorCode)
    .entity(new ErrorMessage(
      errorCode.getStatusCode(),
      "Database exception: " + exc.getCode(),
      exc.getLocalizedMessage()
  )).build();
}