Questions tagged [try-catch]

try-catch is a syntactic construct for catching exceptions raised by a code section

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Raise & return error with message if no key found in mapping

I am writing a test that should fail because it looks for a key that doesn't exist on a mapping. How can I raise the error with and error message in solidity? this is the test: it('Should NOT update ...
1
vote
0answers
89 views

Catch Internal Out of Gas Exception in Solidity Code

I ran this transaction which executed correctly, but one of the internal calls gave me back an out of gas error. I had a try/catch mechanism to let my code terminate silently (to set some really ...
5
votes
1answer
545 views

Is it possible to perform a try-catch in Solidity?

Does Solidity support try-catch functionality? If so, how does it work? What are the limitations?