mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Document user provided exceptions
This commit is contained in:
parent
7f726de1cb
commit
39cd2214f2
@ -396,6 +396,10 @@ Currently, Solidity automatically generates a runtime exception in the following
|
|||||||
#. If your contract receives Ether via a public getter function.
|
#. If your contract receives Ether via a public getter function.
|
||||||
#. If you call a zero-initialized variable of internal function type.
|
#. If you call a zero-initialized variable of internal function type.
|
||||||
|
|
||||||
|
While a user-provided exception is generated in the following situations:
|
||||||
|
#. Calling ``throw``.
|
||||||
|
#. The condition of ``assert(condition)`` is not met.
|
||||||
|
|
||||||
Internally, Solidity performs an "invalid jump" when a user-provided exception is thrown. In contrast, it performs an invalid operation
|
Internally, Solidity performs an "invalid jump" when a user-provided exception is thrown. In contrast, it performs an invalid operation
|
||||||
(instruction ``0xfe``) if a runtime exception is encountered. In both cases, this causes
|
(instruction ``0xfe``) if a runtime exception is encountered. In both cases, this causes
|
||||||
the EVM to revert all changes made to the state. The reason for this is that there is no safe way to continue execution, because an expected effect
|
the EVM to revert all changes made to the state. The reason for this is that there is no safe way to continue execution, because an expected effect
|
||||||
|
Loading…
Reference in New Issue
Block a user