try catch 把我搞抑郁了 #434
Unanswered
leiganglee
asked this question in
Q&A
Replies: 4 comments 9 replies
-
怎么搞的吗,这个怎么提交都是错误的 |
Beta Was this translation helpful? Give feedback.
1 reply
-
谁能解答一下这个答案呀,卡死在这里。。。 |
Beta Was this translation helpful? Give feedback.
7 replies
-
以下异常返回值类型为bytes的: 以上皆是 |
Beta Was this translation helpful? Give feedback.
1 reply
-
只要能發出異常就能被捕捉,revert, require assert 都可以發出異常
revert, require assert 都是回傳 bytes,catch 後面在乎的是回傳的訊息能不能正確的被解碼
有可能,catch 解碼失敗的異常沒有辦法被捕捉
不會 自己寫的有關 error 的文章:https://wiasliaw.github.io/persona/How-%60try-catch%60-works-in-solidity |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Try Catch
try-catch可以捕获什么异常? revert() require() assert()
以下异常返回值类型为bytes的是. assert()
try-catch捕获到异常后是否会使try-catch所在的方法调用失败. 不会
try代码块内的revert是否会被catch本身捕获 不会
上面的答案有哪个是错的吗。为什么总是提示我错了一个。这是哪个错了。
Beta Was this translation helpful? Give feedback.
All reactions