-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve artifact download error message #2482
Conversation
Fixes #2289 Unfortunately took more RecoverableError hijinx than I would have liked. There might be a better way.
client/task_runner.go
Outdated
if rerr, ok := err.(*structs.RecoverableError); ok { | ||
return structs.NewRecoverableError(wrapped, rerr.Recoverable) | ||
if rerr, ok := err.(structs.Recoverable); ok { | ||
return structs.NewRecoverableError(wrapped, rerr.Recoverable()) |
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.
return structs.NewRecoverableError(wrapped, structs.IsRecoverable(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.
Everywhere this pattern is used
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.
It honestly might be worth adding a helper function.
func NewWrappedRecoverableError(wrapped, original) { ... }
It just checks if the original is recoverable.
0e80e7c
to
a1e24d9
Compare
a1e24d9
to
ae9d495
Compare
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #2289
Unfortunately took more RecoverableError hijinx than I would have liked.
There might be a better way.