efugier / smartcat

Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.
https://crates.io/crates/smartcat
Apache License 2.0
77 stars 9 forks source link

fix: better error on API call failure #5

Closed CBenoit closed 9 months ago

CBenoit commented 9 months ago

On master: image

With this patch: image

I was unable to troubleshoot my problem with the initial error. Of course, it’s possible to use curl directly or to inspect the traffic instead, but it’s more convenient if the tool can report more details. :slightly_smiling_face:

efugier commented 9 months ago

That's way better, thanks!

efugier commented 9 months ago

Hey, FYI the changes were unstable, I updated them there.

My bad, I need to have the CI check that!

CBenoit commented 9 months ago

This has been stabilized since Rust 1.74, but if you have a specific msrv you probably want to avoid this API indeed

efugier commented 9 months ago

Ow so that's why the CI didn't catch it!

I don't have a msrv but I wasn't up to locally date. That's a very recent change, I reverted my commit, thanks for explaining :slightly_smiling_face:

CBenoit commented 9 months ago

My pleasure!

By the way, you may want to check out this: https://matklad.github.io/2022/10/24/actions-permissions.html There is no security concern at least as long as there is no secret in your CI and this is generally a better contributor experience (new contributors are able to see the result without waiting for a maintainer) Some people don't always run cargo fmt, clippy or tests before committing, and you will save yourself some communication round trips 🙂

efugier commented 9 months ago

I'll definitely do that !

Tbh I wasn't expecting any contribution ahah