ing
This commit is contained in:
parent
d99f4f76eb
commit
396ab8c3ff
|
@ -76,15 +76,19 @@ public class ServiceProxy {
|
|||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
} catch (OverflowException e) {
|
||||
logger.warning(e.toString());
|
||||
logger.warning(getExceptionMessage(request, e));
|
||||
responseObserver.onError(convertException(e));
|
||||
} catch (OverflowRuntimeException e) {
|
||||
logger.warning(e.toString());
|
||||
logger.warning(getExceptionMessage(request, e));
|
||||
responseObserver.onError(convertException(e));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getExceptionMessage(ServerInput request, Exception e) {
|
||||
return String.format("Target: %s, Method:%s, Params:%s, ex:%s", request.getTarget(), request.getMethod(), request.getParamsList().asByteStringList(), e.toString());
|
||||
}
|
||||
|
||||
protected StatusRuntimeException convertException(OverflowRuntimeException e) {
|
||||
String message = String.format("%s|%s", e.getClass().getSimpleName(), e.getMessage());
|
||||
Status status = Status.fromCode(Status.Code.INTERNAL).withDescription(message);
|
||||
|
|
Loading…
Reference in New Issue
Block a user