zeitgeist
zeitgeist copied to clipboard
[swaps] Improve error handling in `zrml-swaps`
The swaps
pallet currently raises some questionable errors, for example MathApproximation
. These seem very uninformative.
For example, if I call pool_join
with a small amount of liquidity (in comparison to what's already in the pool), then ratio
ends up being zero, and I get a MathApproximation
error:
https://github.com/zeitgeistpm/zeitgeist/blob/b00d69fe67430efd669e54b05de682fcdb8c440a/zrml/swaps/src/utils.rs#L105-L108
How am I supposed to know what happened?