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

Fix formatting of steperror when utilizing errorutil.FormattedError #77

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions step/steperror.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package step

import "errors"

// Error is an error occuring top level in a step
type Error struct {
StepID, Tag, ShortMsg string
Expand Down Expand Up @@ -34,3 +36,11 @@ func NewErrorWithRecommendations(stepID, tag string, err error, shortMsg string,
func (e *Error) Error() string {
return e.Err.Error()
}

func (e *Error) Unwrap() error {
if err := errors.Unwrap(e.Err); err != nil {
return err
}

return nil
}