-
Notifications
You must be signed in to change notification settings - Fork 65
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 ability to wrap an error with an Unimplemented error #86
Comments
Hm so changing the underlying type of the error returned by I suppose that if very well motivated, we could do that. But what about this, changing: return nil, unimplemented.Newf("import.mysql.default", "unsupported default expression %q for column %q: %v", exprString, name, err) to: return nil, errors.Wrapf(
unimplemented.Newf("import.mysql.default", "unsupported default expression"),
"error parsing expression %q for column %q (%v)",` exprString, name, err /* XX lint exclusion */) The difference with the original code is that the |
In both the original and this new example, the |
It's actually an undocumented feature of |
This code is responsible ( λ NewWithDepthf(depth int, format 𝓢, args ...any) error {
var errRefs []error
for _, a ∈ args {
if e, ✓ ≔ a.(error); ✓ {
errRefs = append(errRefs, e)
}
}
// ...
for _, e ∈ errRefs {
err = secondary.WithSecondaryError(err, e)
} |
I have a bit of code that does something like this:
This flattens the
err
argument. What I'd really like is something like(analogous to
errors.Errorf
versuserrors.Wrapf
)The exact piece of code I'm referring to is: https://github.com/cockroachdb/cockroach/blob/7bf398fc9c715e67ae4ab342569b26f50809fb59/pkg/ccl/importccl/read_import_mysql.go#L764
cc @knz
The text was updated successfully, but these errors were encountered: