Skip to content

Conversation

@wfraser
Copy link
Member

@wfraser wfraser commented Mar 13, 2025

Otherwise, with nested errors, you can end up with unhelpful errors like this (example printed by anyhow):

Error: failed to get metadata for "/temp/spoopadoop"

Caused by:
    0: Dropbox API endpoint returned an error: There is nothing at the given path.
    1: There is nothing at the given path.
    2: There is nothing at the given path.

instead, with this change, you get:

Error: failed to get metadata for "/temp/spoopadoop"

Caused by:
    0: Dropbox API endpoint returned an error: GetMetadataError: There is nothing at the given path.
    1: GetMetadataError: There is nothing at the given path.
    2: There is nothing at the given path.

which is less repetitive and gives a better indication of what actually went wrong.

Checklist

General Contributing

  • I have read the Code of Conduct and signed the CLA.
  • I have added an entry to the RELEASE_NOTES.md file, or believe it's not necessary for this change.

Validation

This affects display of errors only; no other behavior change. Display impls are not a fixed format and changes to them shouldn't break things.

wfraser added 2 commits March 13, 2025 14:03
Otherwise, with nested errors, you can end up with unhelpful errors like
this (example printed by `anyhow`):

```
Error: failed to get metadata for "/temp/spoopadoop"

Caused by:
    0: Dropbox API endpoint returned an error: There is nothing at the given path.
    1: There is nothing at the given path.
    2: There is nothing at the given path.
```

instead, with this change, you get:
```
Error: failed to get metadata for "/temp/spoopadoop"

Caused by:
    0: Dropbox API endpoint returned an error: GetMetadataError: There is nothing at the given path.
    1: GetMetadataError: There is nothing at the given path.
    2: There is nothing at the given path.
```
which is less repetitive and gives a better indication of what actually went wrong.
Older rust has a broken half-implementation of MSRV support, in that `cargo update` (or when no lockfile is present) will grab the lastest package, ignoring its MSRV, yet immediately complain that it can't build said package because its MSRV is too high.
@wfraser wfraser force-pushed the error-msg-type-name branch from 7257340 to a851425 Compare March 13, 2025 21:34
@wfraser wfraser merged commit 05429e2 into dropbox:master Mar 13, 2025
2 checks passed
@wfraser wfraser deleted the error-msg-type-name branch March 13, 2025 21:57
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.

1 participant