Samyak2 / toipe

yet another typing test, but crab flavoured
MIT License
595 stars 31 forks source link

Panic if can't find OS wordlist (Fixes #25) #26

Closed benliepert closed 2 years ago

benliepert commented 2 years ago

Improve error message context if we can't read a given word list. Add a ToipeError method, with_context, that prefixes the msg with a str you pass in. Use this method in each of the cases where RawWordSelector initialization can fail when initializing Toipe, so that errors from here say "Error reading the given word list: " at the front. (Fixes #25)

Samyak2 commented 2 years ago

Also, could you add "Fixes #25" to the PR's description to link the issue here?

Samyak2 commented 2 years ago

There's a clippy error. Could you fix it?

Samyak2 commented 2 years ago

I just found this crate - https://github.com/dtolnay/anyhow. It implements almost the same with_context function lol, but seems more convenient to use.

Let's not change anything in this PR now, but it would be nice to move to using anyhow in the future instead of what's being done currently.

Samyak2 commented 2 years ago

Hey @benliepert, just checking in. Will you be able to complete this PR soon? It's completely fine if you do not find the time for it, I can wrap up the PR and merge it :)