dateparser icon indicating copy to clipboard operation
dateparser copied to clipboard

Convert `anyhow::Result`s in parsing functions to custom error type.

Open cogsandsquigs opened this issue 2 years ago • 1 comments

I like this library, but one downside is that it returns an anyhow::Result instead of a custom error type. Generally, it's better for libraries to implement these custom error types as it gives more information to the user about what went wrong, as anyhow::Result can be very vague at times. Consider possibly using thiserror or snafu? That way I can actually see (and report!) what went wrong instead of dealing with an opaque type returned by anyhow.

cogsandsquigs avatar Mar 10 '23 00:03 cogsandsquigs

Hey @cogsandsquigs, thanks for the suggestion. That's a great idea. I will take a look at thiserror and snafu, and make improvements on error handling.

waltzofpearls avatar Mar 10 '23 18:03 waltzofpearls