Open njordhov opened 2 years ago
Hey @njordhov, are you asking that the transaction receipt include something more informative than (err none)
? Because if so, this isn't a breaking change, and could be done in the next release. Please elaborate?
@jcnelson Yes, it's about making the transaction receipt more informative on Clarity panics. Minimally, it should provide an error message with the specific reason for the failure, or the triggering error for unwrap-panic
. Better, a record (aka tuple) with more details including the name of the function in which the panic occurred and the location in the contract code of the failing call.
Temporarily assigning to @obycode. Feel free to re-assign :)
EDIT: damn fat fingers
Panic in Clarity contracts results in a useless and uninformative
(err none)
reported to the caller when the contract aborts, whether triggered byunwrap-panic
or a failure such as an uint subtraction underflow.Instead, a panic should provide a useful error message so the caller can understand why the contract call was aborted.
The lack of helpful panic messages leads to confused developers, ad-hoc workarounds, and avoidance of
unwrap-panic
, an anti-pattern. The clarity-lang book even explicitly advises against usingunwrap-panic
due to the lack of a useful response:See also: