-
Notifications
You must be signed in to change notification settings - Fork 32
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 MultiOperation errors #158
Conversation
488da9c
to
8ea7498
Compare
adde912
to
74f3253
Compare
@@ -71,7 +72,21 @@ func FromStatus(st *status.Status) error { | |||
return nil | |||
} | |||
|
|||
// Simple case. `st.Code()` to `serviceerror` is one to one mapping and there are no error details. | |||
errDetails := extractErrorDetails(st) |
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.
The error parsing had to be changed so that it always parses the error details first. This adds an extra step for status codes such as Unavailable and Canceled, but is most likely negligible.
ad53860
to
4df4a52
Compare
9e919b6
to
6ced852
Compare
serviceerror/convert.go
Outdated
case *failure.MultiOperationExecutionAborted: | ||
return newMultiOperationAborted(st) | ||
default: | ||
return st.Err() |
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.
I would do same as on line 190, or add generic AbortedError
with empty details.
serviceerror/multiOpAborted.go
Outdated
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.
multi_op_aborted.go
please. And someone need to rename all other files in this package.
serviceerror/multiOpAborted.go
Outdated
} | ||
|
||
// NewMultiOperationAbortedError returns MultiOperationAborted. | ||
func NewMultiOperationAbortedError(message string) error { |
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.
You need to be consistent in using Error
suffix. I agree on not using Failure
suffix for proto message and I would prefer to use Error
suffix for error because it is essentially a error in go world. Or remove Error()
method.
Makefile
Outdated
@@ -41,7 +41,7 @@ $(PROTO_OUT): | |||
##### git submodule for proto files ##### | |||
update-proto-submodule: | |||
printf $(COLOR) "Update proto-submodule..." | |||
git -c protocol.file.allow=always submodule update --init --force --remote $(PROTO_ROOT) | |||
#git -c protocol.file.allow=always submodule update --init --force --remote $(PROTO_ROOT) |
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.
Don't forget to uncomment this.
63c31bf
to
f696245
Compare
f696245
to
e030e93
Compare
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.
I was intentionally waiting on API repo merge before giving approval here, but it looks like it was merged w/ no SDK approval because our branch protections and codeowners don't require it. I wonder if we should change this repo to be like the api
repo w/ the restrictions there.
@cretz I agree, it's probably a good idea to require SDK approval here. I looked over the recent PRs and most - but not all - had SDK approval (but most didn't have Server approval). |
What changed?
Added two new error types, both for MultiOperationExecution.
The errors behavior was documented in temporalio/api#367.
Why?
To return these errors from the Server (see PR).
How did you test it?
Add new tests and Server implementation PR.
Potential risks
None