ing
This commit is contained in:
parent
d99f4f76eb
commit
396ab8c3ff
|
@ -76,15 +76,19 @@ public class ServiceProxy {
|
||||||
responseObserver.onNext(reply);
|
responseObserver.onNext(reply);
|
||||||
responseObserver.onCompleted();
|
responseObserver.onCompleted();
|
||||||
} catch (OverflowException e) {
|
} catch (OverflowException e) {
|
||||||
logger.warning(e.toString());
|
logger.warning(getExceptionMessage(request, e));
|
||||||
responseObserver.onError(convertException(e));
|
responseObserver.onError(convertException(e));
|
||||||
} catch (OverflowRuntimeException e) {
|
} catch (OverflowRuntimeException e) {
|
||||||
logger.warning(e.toString());
|
logger.warning(getExceptionMessage(request, e));
|
||||||
responseObserver.onError(convertException(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) {
|
protected StatusRuntimeException convertException(OverflowRuntimeException e) {
|
||||||
String message = String.format("%s|%s", e.getClass().getSimpleName(), e.getMessage());
|
String message = String.format("%s|%s", e.getClass().getSimpleName(), e.getMessage());
|
||||||
Status status = Status.fromCode(Status.Code.INTERNAL).withDescription(message);
|
Status status = Status.fromCode(Status.Code.INTERNAL).withDescription(message);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user