tonarino / just-gl

Run an OpenGL application on Linux, and nothing more.
1 stars 0 forks source link

Proper error handling #6

Open strohel opened 11 months ago

strohel commented 11 months ago

Currently we do just .expect(), which doesn't scale.

Do people (@mbernat?) have opinions on "dynamic" errors (anyhow) vs. more statically defined (thiserror)?

If we target being a library, then static thiserror-like errors are more appropriate, but I wonder if that isn't an overkill doing now in the prototyping phase. (we should start with anyhow and eventually convert to thiserror).

And meybe there's some alternative to the 2 mentioned libraries?

PabloMansanet commented 11 months ago

Personally, for this prototyping phase I'm OK with anyhow. As an alternative we could use eyre, which I haven't used for any personal project yet but I hear is pretty good (I kinda remember one of you using it for something, but I'm not sure)

mbernat commented 11 months ago

I don't think the two approaches are exclusive, thiserror to define good errors where they make sense and anyhow / eyre for error reporting.

Even for a prototype it would be nice to have a little bit of library code, I'm not super fond of having everything in main.rs.

goodhoko commented 11 months ago

@PabloMansanet we were using eyre in my evaluation project 😉 The advantage over anyhow is probably the nicely colored output. .)