golemfactory / gumpi

MPI on Golem Unlimited PoC
GNU Affero General Public License v3.0
2 stars 3 forks source link

Move failure_ext to a separate crate. Update the dependencies #50

Closed marmistrz closed 5 years ago

marmistrz commented 5 years ago

Related to #46. The failure_ext crate is available here: https://github.com/marmistrz/failure_ext

I created my own crate because this PR hasn't been merged since Nov 2018.

mplebanski commented 5 years ago

Rust implicitness FTW

mplebanski commented 5 years ago

Why does one want to wrap an error into a context?

marmistrz commented 5 years ago

See how context is used throughout gumpi. For instance here: https://github.com/golemfactory/gumpi/blob/ecd4c53684fd2e3ba67c011fcaabefee5b8d2756/src/jobconfig.rs#L41 And how the final error message is constructed: https://github.com/golemfactory/gumpi/blob/ecd4c53684fd2e3ba67c011fcaabefee5b8d2756/src/main.rs#L26

Usually the errors are really sparse in Rust, so we need to use context to add more and more context to the error, so that it's anyhow useful to the user.