aboutsummaryrefslogtreecommitdiffstats
path: root/docs/control-structures.rst
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-10 21:31:40 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-10 21:31:40 +0800
commit39cd2214f2161d2e09ab0de21a64f6dcdb851b13 (patch)
tree174ece8cd16d4c13a2084283b1fe168e387ce81e /docs/control-structures.rst
parent7f726de1cb861f4c7cb4e89e4ec56cd5712d0855 (diff)
downloaddexon-solidity-39cd2214f2161d2e09ab0de21a64f6dcdb851b13.tar.gz
dexon-solidity-39cd2214f2161d2e09ab0de21a64f6dcdb851b13.tar.zst
dexon-solidity-39cd2214f2161d2e09ab0de21a64f6dcdb851b13.zip
Document user provided exceptions
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r--docs/control-structures.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 1c7d71f2..ff0a48ec 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -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 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
(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