| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| Expand Up | @@ -16,7 +16,6 @@ | |||||
|
|
||||||
| package com.google.cloud.spanner.spi.v1; | ||||||
|
|
||||||
| import static com.google.cloud.spanner.SpannerExceptionFactory.asSpannerException; | ||||||
| import static com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException; | ||||||
| import static com.google.cloud.spanner.ThreadFactoryUtil.tryCreateVirtualThreadPerTaskExecutor; | ||||||
|
|
||||||
| Expand Down Expand Up | @@ -539,7 +538,7 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCalla | |||||
| // is actually running. | ||||||
| checkEmulatorConnection(options, channelProvider, credentialsProvider, emulatorHost); | ||||||
| } catch (Exception e) { | ||||||
| throw asSpannerException(e); | ||||||
| throw newSpannerException(e); | ||||||
| } | ||||||
| } else { | ||||||
| this.databaseAdminStub = null; | ||||||
| Expand Down Expand Up | @@ -727,7 +726,7 @@ private <T> T runWithRetryOnAdministrativeRequestsExceeded(Callable<T> callable) | |||||
| new AdminRequestsLimitExceededRetryAlgorithm<>(), | ||||||
| NanoClock.getDefaultClock()); | ||||||
| } catch (RetryHelperException e) { | ||||||
| throw asSpannerException(e.getCause()); | ||||||
| throw SpannerExceptionFactory.asSpannerException(e.getCause()); | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis change to fully qualify asSpannerException seems inconsistent with the overall goal of the revert, which appears to be replacing asSpannerException with newSpannerException. Other parts of this file and the PR make that replacement. For consistency, this should probably be newSpannerException(e.getCause()).
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Expand Down Expand Up | @@ -1318,7 +1317,7 @@ public OperationFuture<Empty, UpdateDatabaseDdlMetadata> updateDatabaseDdl( | |||||
| throw newSpannerException(e); | ||||||
| } catch (ExecutionException e) { | ||||||
| Throwable t = e.getCause(); | ||||||
| SpannerException se = asSpannerException(t); | ||||||
| SpannerException se = SpannerExceptionFactory.asSpannerException(t); | ||||||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualitySimilar to other comments, this change to fully qualify asSpannerException is inconsistent with the revert. To maintain consistency with other changes in this PR, this should probably be newSpannerException(t).
Suggested change
Sorry, something went wrong.
All reactions
|
||||||
| if (se instanceof AdminRequestsPerMinuteExceededException) { | ||||||
| // Propagate this to trigger a retry. | ||||||
| throw se; | ||||||
| Expand Down Expand Up | @@ -1984,12 +1983,8 @@ private static <T> T get(final Future<T> future) throws SpannerException { | |||||
| // We are the sole consumer of the future, so cancel it. | ||||||
| future.cancel(true); | ||||||
| throw SpannerExceptionFactory.propagateInterrupt(e); | ||||||
| } catch (ExecutionException e) { | ||||||
| throw asSpannerException(e.getCause()); | ||||||
| } catch (CancellationException e) { | ||||||
| } catch (Exception e) { | ||||||
| throw newSpannerException(context, e, null); | ||||||
| } catch (Exception exception) { | ||||||
| throw asSpannerException(exception); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Expand Down Expand Up | @@ -2227,7 +2222,7 @@ public void onError(Throwable t) { | |||||
| if (this.consumer.cancelQueryWhenClientIsClosed()) { | ||||||
| unregisterResponseObserver(this); | ||||||
| } | ||||||
| consumer.onError(asSpannerException(t)); | ||||||
| consumer.onError(newSpannerException(t)); | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| Expand Down | ||||||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis change seems inconsistent with the rest of the revert. Other occurrences of asSpannerException are being changed to newSpannerException, but this one is kept and fully qualified. For consistency, shouldn't this also be changed to newSpannerException(t)? The static import for newSpannerException is available.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.