Repository navigation
Wrap Go SDK errors w/ help blurb. - #3342
Conversation
👷 Deploy request for cloak-docs pending review.Visit the deploys page to approve it
|
|
#3350 will provide the URL needed to complete this PR |
|
Just FYI this PR: #3349 may result in the need to also wrap the Just mentioning in case that happens while I'm on PTO next week. |
ebfe274 to
7d80732
Compare
There was a problem hiding this comment.
Updated with the URL from here: https://github.com/dagger/dagger.io/pull/980#pullrequestreview-1141566520
Including the #go as suggested here: #3316 (comment)
Let me know if you agree with the phrasing here.
|
@aluzzardi @shykes can you take a moment to review and merge? |
|
Have to fix something after the rebase on main, but let me know if the blurb needs any updates in the meantime |
f8d9d76 to
aa9eba7
Compare
|
Updated, @aluzzardi wrapping the whole gql client just to annotate all errors is a little meh but it was an easy way to ensure that every use of it got the error wrapping (including direct use of Happy to take a different approach if you think it's going to cause issues. |
| func Connect(ctx context.Context, opts ...ClientOpt) (*Client, error) { | ||
| func Connect(ctx context.Context, opts ...ClientOpt) (_ *Client, rerr error) { | ||
| defer func() { | ||
| if rerr != nil { |
There was a problem hiding this comment.
I fail to see where this rerr is set.
I will checkout the code and check my assumption and come back to this.
There was a problem hiding this comment.
I confirm that rerr is not set here.
Should we intercept any error in Connect and set rerr instead? Or just the c.conn.Connect(ctx, cfg)?
There was a problem hiding this comment.
I might be misunderstanding but rerr should be set whenever the second return val in non-nil anywhere in the func. E.g. https://go.dev/play/p/6vwRL72pmoV
Signed-off-by: Erik Sipsma <[email protected]>
| func Connect(ctx context.Context, opts ...ClientOpt) (_ *Client, rerr error) { | ||
| defer func() { | ||
| if rerr != nil { | ||
| rerr = withErrorHelp(rerr) |
There was a problem hiding this comment.
Will this actually wrap the error in return nil, err? I thought everywhere had to assign rerr 🤔
There was a problem hiding this comment.
Signed-off-by: Erik Sipsma [email protected]
#3316
Need to update error message wrapper obviously once we decide exactly where we want to link to.
Did not just put this in
engine.Startsince we are planning on refactoring that out soon (cc @aluzzardi )