@Override
protected Throwable convertException(Throwable cause) {
if (cause instanceof ApiProxy.ApplicationException) {
ApiProxy.ApplicationException e = (ApiProxy.ApplicationException) cause;
ErrorCode errorCode = LogServiceError.ErrorCode.valueOf(e.getApplicationError());
if (errorCode == LogServiceError.ErrorCode.INVALID_REQUEST) {
return new InvalidRequestException(e.getErrorDetail());
}
return new LogServiceException(e.getErrorDetail());
}