headcrab icon indicating copy to clipboard operation
headcrab copied to clipboard

Implement proper error types

Open nbaksalyar opened this issue 4 years ago • 5 comments

Currently, all error types are returned as Box<dyn std::error::Error>, which is a quick & dirty way of doing it. We should have descriptive error types.

nbaksalyar avatar Jul 17 '20 21:07 nbaksalyar

@nbaksalyar Do we have a preference for a crate that we want to use here ? Would Anyhow work ?

blitzerr avatar Sep 14 '20 18:09 blitzerr

Anyhow is for executables. It doesn't allow you to match on the error. Something like thiserror makes more sense. That crate makes it easier to derive Error for regular enums.

bjorn3 avatar Sep 14 '20 18:09 bjorn3

Makes sense.

blitzerr avatar Sep 14 '20 20:09 blitzerr

Is this issue still open I'd be interested in taking a look at adding an error type. Would you rather use thiserror or do it the long way with a bunch of Into impls?

DevinR528 avatar Oct 11 '20 11:10 DevinR528

Using thiserror is probably easier.

bjorn3 avatar Oct 11 '20 11:10 bjorn3