0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
32 stars 28 forks source link

refactor: library api errors refactor #374

Closed mFragaBA closed 2 months ago

mFragaBA commented 4 months ago

This PR removes the root errors module and moves each error to its corresponding submodule.

mFragaBA commented 3 months ago

Not sure if this is ready for review - but I took a quick look and everything looks good. Thank you! I left just a couple of very minor comments inline.

I was waiting for mFragaBA-library-api-refactors to get merged before, but besides that it is.

On a side note, I'm wondering whether we should keep the general ClientError and StoreError or it'd be better to provide an error type for each method. It's a bit more work on our side but I think it'd be clearer in error types what things can go wrong and might also make it easier for users of the library of the crate to implement error handling. Do you have any preference. (I've recently read https://mmapped.blog/posts/12-rust-error-handling so I might be a bit biased towards that approach :p)