Skip to content

Conversation

@soupi
Copy link
Contributor

@soupi soupi commented Apr 16, 2024

What

https://hasurahq.atlassian.net/browse/V3DX-1053

Before:

$ CONNECTION_URI="postgresql://re" cargo run --bin ndc-postgres-cli -- --context='/tmp/baba' update
Error: error communicating with database: failed to lookup address information: Name or service not known

Caused by:
    failed to lookup address information: Name or service not known

After:

$ CONNECTION_URI="postgresql://re" cargo run --bin ndc-postgres-cli -- --context='/tmp/baba' update
ERROR: error communicating with database: failed to lookup address information: Name or service not known

How

Instead of having a main() -> anyhow::Result<()>, we explicitly handle printing the error.
https://docs.rs/anyhow/1.0.69/anyhow/struct.Error.html#display-representations

@soupi soupi requested a review from SamirTalwar April 16, 2024 07:06
@soupi soupi enabled auto-merge April 16, 2024 08:13
@soupi soupi added this pull request to the merge queue Apr 16, 2024
Merged via the queue into main with commit f64d683 Apr 16, 2024
@soupi soupi deleted the gil/format-anyhow-error-cli branch April 16, 2024 08:20
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.

2 participants