tangle-network / gadget

A framework for building modular AVS and Tangle Blueprints: https://docs.tangle.tools/developers/blueprints.
https://tangle.tools
Apache License 2.0
12 stars 3 forks source link

[TASK] Improve error handling, remove Infallible #345

Open drewstone opened 6 days ago

drewstone commented 6 days ago

Overview

I still have no idea why anyone ever chose Infallible. What is this? Get it out of here.

shekohex commented 5 days ago

Infallible just means it would never fail, you can't construct the Infallible type.

Our SDK requires every job to return a Result, this is good because it forces you to think about error handling in your design. However, for a hello world blueprint, the say_hello job, for example, does not have a fillable path, hence we return Infallible in the result type, indicating that this job never fails.

I encourage you to read more about it here: https://doc.rust-lang.org/stable/core/convert/enum.Infallible.html

PS you don't have to use it, we never enforced that.