With the changeover from panicking on errors to returning & handling them in dApps, gstd::errors::ContractError and, perhaps, all types in the gstd::error module should implement the Encode, Decode, and TypeInfo traits so that it'd possible to return & handle them.
Problem to Solve
With the changeover from panicking on errors to returning & handling them in dApps,
gstd::errors::ContractError
and, perhaps, all types in thegstd::error
module should implement theEncode
,Decode
, andTypeInfo
traits so that it'd possible to return & handle them.E.g. the current approach simply converts
ContractError
toString
that's only useful for debugging: https://github.com/gear-dapps/supply-chain/blob/790957b5e7c2eabef87ffe1d58c6d994f4bbe0b6/io/src/lib.rs#L545-L549Possible Solution
See the title.
Notes
No response