inkwell icon indicating copy to clipboard operation
inkwell copied to clipboard

Specific error types for errors instead of &'static str

Open ErisianArchitect opened this issue 4 months ago • 3 comments

Is your feature request related to a problem? Please describe. Without specific error types, it can be difficult if not impossible to determine what the cause of the error is without reading the string, which makes debugging a little harder to do.

Describe the solution you'd like These &'static str errors could be replaced with error types specific to those errors.

Describe possible drawbacks to your solution This would not be a backwards compatible change.


I don't mind attempting to contribute this to inkwell, but I don't want to change anything if someone thinks it's a bad idea.

ErisianArchitect avatar Aug 15 '25 08:08 ErisianArchitect

Yes, I agree. This is mostly tech debt from the days before thiserror and rust having any sort of good error type guidlines

TheDan64 avatar Aug 16 '25 14:08 TheDan64

I can make a rather opinionated attempt at making this change. I'm not sure what you would prefer in terms of errors, but I can give it a shot in my next pull request.

ErisianArchitect avatar Aug 16 '25 17:08 ErisianArchitect

https://github.com/TheDan64/inkwell/pull/598

I've submitted a pull request.

ErisianArchitect avatar Aug 16 '25 20:08 ErisianArchitect