-
Notifications
You must be signed in to change notification settings - Fork 113
add serviceclient exceptions #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add serviceclient exceptions #989
Conversation
@@ -0,0 +1,4 @@ | |||
package com.uber.cadence.serviceclient.exceptions; | |||
|
|||
public class QueryFailedException extends ServiceClientException { |
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.
This is unused
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.
deleted
@@ -0,0 +1,4 @@ | |||
package com.uber.cadence.serviceclient.exceptions; | |||
|
|||
public class StickyWorkerUnavailableException extends ServiceClientException { |
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.
This is unused and I don't think can actually propagate to the client
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.
deleted
|
||
Status status = StatusProto.fromThrowable(e); | ||
if (status == null || status.getDetailsCount() == 0) { | ||
return new ServiceClientException("empty status or status with empty details", e); |
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.
Nit: When can this happen? What kind of exception does GRPC throw if we have a connection issue rather than an error returned by the server?
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.
Server controls whether to pass details. https://github.com/uber/cadence/blob/f4e219ae4248552e53a8ba57036b9af62485221b/common/types/mapper/proto/errors.go#L274
I've simplified the logic to handle such cases.
adcc039
into
cadence-workflow:feature/issue-985/thrift-deprecation
What changed?
Why?
thrift exceptions are used across Java SDK. It's easier to abstract the protocol level error handling by introducing internal exception layer
How did you test it?
Potential risks
Release notes
Documentation Changes