Odonno / surrealdb-migrations

An awesome SurrealDB migration tool, with a user-friendly CLI and a versatile Rust library that enables seamless integration into any project.
https://crates.io/crates/surrealdb-migrations
MIT License
210 stars 16 forks source link

:package: Replace anyhow with color_eyre #57

Closed liamwh closed 10 months ago

liamwh commented 10 months ago

Motivation

I was experiencing some issues using the CLI (my fault). The error messages were produced unhelpful (such as Error: No such file or directory (os error 2), and I didn't know where the error was originating from.

Solution

To resolve this, I replaced anyhow with color_eyre as it improves upon anyhow in multiple ways. It not only improves the aesthetics of the error messages, but provides a much more useful stack trace, which pointed me to the issue in io.rs, so I improved the feedback of the error in io.rs, and this helped me identify the issue I was having.

Additionally, I added context messages to all ensure! macro calls in the integration tests to provide more context in the case of failures.

Odonno commented 10 months ago

Hi @liamwh

That looks fantastic. Will merge it ASAP.