Add internal fatal error code

This commit is contained in:
Sergey Kuznetsov
2026-08-11 17:36:52 +01:00
parent 95526371b0
commit ecc2f07ea3
10 changed files with 83 additions and 41 deletions

View File

@@ -44,6 +44,15 @@ enum class HostFunctionError : int32_t {
IndexOutOfBounds = -18,
FloatInputMalformed = -19,
FloatComputationError = -20,
// The call was not served at all, so the engine stops the run and the transaction is
// tecINTERNAL rather than the contract being handed a code to interpret. `guarded`
// answers it for a host body that throws.
//
// Outside the -1 ..= -20 range that a contract reads, and the only entry that is: it
// needs no number in that range, and INT32_MIN cannot collide with a code appended
// above. Negative so that a reader treating it as an ordinary failure is still right.
InternalFatal = std::numeric_limits<int32_t>::min(),
};
template <typename T>