Skip to content
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

Update error code and message for missing activity task. #2561

Merged
merged 2 commits into from
Mar 2, 2022
Merged

Update error code and message for missing activity task. #2561

merged 2 commits into from
Mar 2, 2022

Conversation

jbreiding
Copy link
Contributor

What changed?
Error code and message for missing activity task

Why?
A bit more clear on reason for failure and direction for investigation
#2538

How did you test it?
unit tests

Potential risks
None

Is hotfix candidate?
No

@jbreiding jbreiding requested a review from a team as a code owner March 1, 2022 16:44
@@ -2850,11 +2850,11 @@ func getScheduleID(
) (int64, error) {

if activityID == "" {
return 0, serviceerror.NewInvalidArgument("Neither ActivityID nor ScheduleID is provided")
return 0, serviceerror.NewInvalidArgument("invalid ActivityID provided")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid activity ID ?

Copy link
Contributor Author

@jbreiding jbreiding Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that is a fair point.
idiomatic go says errors should be lower cased so they can be fmt'ed into a logging line which may be sentenced cased.

I did depart from what was there before, happy to change though to keep consistency.

I can definitely break apart ActivityID.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just say activityID cannot be empty

}
activityInfo, ok := mutableState.GetActivityByActivityID(activityID)
if !ok {
return 0, serviceerror.NewInvalidArgument("Cannot locate Activity ScheduleID")
return 0, serviceerror.NewNotFound(fmt.Sprintf("cannot locate active task for ActivityID %s, check workflow execution history for more details", activityID))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest: cannot find pending activity with ActivityID %s

@@ -2850,11 +2850,11 @@ func getScheduleID(
) (int64, error) {

if activityID == "" {
return 0, serviceerror.NewInvalidArgument("Neither ActivityID nor ScheduleID is provided")
return 0, serviceerror.NewInvalidArgument("invalid ActivityID provided")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just say activityID cannot be empty

@jbreiding jbreiding merged commit 19cee07 into temporalio:master Mar 2, 2022
@jbreiding jbreiding deleted the helpful-error-message branch March 2, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INVALID_ARGUMENT thrown when trying to complete an activity thats already completed
3 participants