diff options
author | Denton Liu <liu.denton+github@gmail.com> | 2016-07-30 02:02:43 +0800 |
---|---|---|
committer | Denton Liu <liu.denton+github@gmail.com> | 2016-07-30 02:04:47 +0800 |
commit | e3a942c7388d5861ed4fba3884910bd0efac17b1 (patch) | |
tree | 66d348a8f0a1e6aa1e10d67722e058e2d2a04812 | |
parent | 56727d61a61e1485c8360f00700d766632ec7163 (diff) | |
download | dexon-solidity-e3a942c7388d5861ed4fba3884910bd0efac17b1.tar.gz dexon-solidity-e3a942c7388d5861ed4fba3884910bd0efac17b1.tar.zst dexon-solidity-e3a942c7388d5861ed4fba3884910bd0efac17b1.zip |
Throw if send() fails in example code
-rw-r--r-- | docs/types.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/types.rst b/docs/types.rst index 50e86ed0..98927607 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -542,7 +542,8 @@ shown in the following example: Campaign c = campaigns[campaignID]; if (c.amount < c.fundingGoal) return false; - c.beneficiary.send(c.amount); + if (!c.beneficiary.send(c.amount)) + throw; c.amount = 0; return true; } |