Exception handling syntax: Difference between revisions

Content deleted Content added
Haskell: I have no idea what genius wrote this but it doesn’t even compile.
Tags: Mobile edit Mobile web edit
No edit summary
Tags: Mobile edit Mobile web edit
Line 205:
 
int main() {
try {
// do something (might throw an exception)
} catch (const std::exception& e) {
}
catch (const std::exception& e) {
// handle exception e
} catch (...) {
catch (...) {
// catches all exceptions, not already caught by a catch block before
// can be used to catch exception of unknown or irrelevant type
}
}
</syntaxhighlight>