You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some cases where we use custom error, but Panic codes may be more relevant/standard.
Some example (not exaustive):
In Math.mulDiv, if the prod1 > denominator, we should probably Panic with 0x11 (ARITHMETIC_UNDER_OR_OVERFLOW) if denominator > 0 or 0x12 (DIVISION_BY_ZERO) if denominator == 0 instead of using MathOverflowedMulDiv
There are some cases where we use custom error, but Panic codes may be more relevant/standard.
Some example (not exaustive):
In
Math.mulDiv
, if theprod1 > denominator
, we should probably Panic with0x11
(ARITHMETIC_UNDER_OR_OVERFLOW) if denominator > 0 or0x12
(DIVISION_BY_ZERO) if denominator == 0 instead of usingMathOverflowedMulDiv
In DoubleEndedQueue, we should probably replace
QueueEmpty
→ panic 0x31 (POP_ON_EMPTY_ARRAY)QueueFull
→ panic 0x32 (ARRAY_ACCESS_OUT_OF_BOUNDS)QueueOutOfBounds
→ panic 0x41 (TOO_MUCH_MEMORY_ALLOCATED)The text was updated successfully, but these errors were encountered: