savoryink / setfont

Set the font of your favorite editors and terminals
MIT License
0 stars 2 forks source link

Add error module #16

Closed Hermitter closed 4 years ago

nvzqz commented 4 years ago

I actually don't think this tool needs a global Error type.

SInce the time you've made this, I made it the main thread's responsibility to exit if an error occurs: https://github.com/savoryink/setfont/blob/8f8db2ae2447b8321bfe81c75690eff381ecddb3/src/main.rs#L99-L101

I think instead of a global error, App::apply could return Result<(), Box<dyn std::error::Error>>, which then gets reported where it returns: https://github.com/savoryink/setfont/blob/8f8db2ae2447b8321bfe81c75690eff381ecddb3/src/main.rs#L93-L95

If we're doing that approach, then did_error doesn't need to belong in Shared and instead can be updated to false where the error gets reported.