Closed
Description
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)