Content deleted Content added
No edit summary |
No edit summary Tags: Mobile edit Mobile app edit iOS app edit App section source |
||
(2 intermediate revisions by one other user not shown) | |||
Line 207:
try {
// do something (might throw an exception)
} catch (const std::runtime_error e) {
// handle a runtime_error e
} catch (const std::exception& e) {
//
} catch (...) {
// catches all
}
}
Line 587 ⟶ 588:
} catch (error) {
// Statements that execute in the event of an exception
}
</syntaxhighlight>
=== Kotlin ===
{{Further|Kotlin (programming language)}}
<syntaxhighlight lang="kotlin">
try {
// Code that may throw an exception
} catch (e: SomeException) {
// Code for handling the exception
}
</syntaxhighlight>
|