{"id":14,"date":"2006-01-10T23:31:50","date_gmt":"2006-01-11T04:31:50","guid":{"rendered":"http:\/\/bitpost.com\/news\/?p=14"},"modified":"2006-02-13T19:13:59","modified_gmt":"2006-02-14T00:13:59","slug":"c-exception-handling-is-terminal","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2006\/c-exception-handling-is-terminal\/","title":{"rendered":"C++ exception handling is &#8220;terminal&#8221;"},"content":{"rendered":"<p>The other day my coworker Gamini asked me if there were a C++ exception handling mechanism to &#8220;continue&#8221; from where the exception was thrown. I thought I remembered some obsure keyword&#8230; wrong, C++ exception handling follows a &#8220;termination model&#8221;, the stack is unwound as you go, the damage is done before you hit the exception handler, and there&#8217;s no going back. In this case, there are some other languages (Smalltalk, Lisp) that do a better job than C++, by providing a &#8220;resumption model&#8221; of exception handling. When an exception is thrown, these languages walk back up the stack without destroying it, or preserve it in some other way, so that a &#8220;resume&#8221; is possible if the exception is &#8220;tolerable&#8221; (after you log the condition or take some other moderate action). Wikipedia has a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Exception_handling#Condition_systems\">good discussion<\/a>.  And of course boost peoples have <a href=\"http:\/\/lists.boost.org\/Archives\/boost\/2002\/06\/30784.php\">an even livelier one<\/a>, as expected.  :><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day my coworker Gamini asked me if there were a C++ exception handling mechanism to &#8220;continue&#8221; from where the exception was thrown. I thought I remembered some obsure keyword&#8230; wrong, C++ exception handling follows a &#8220;termination model&#8221;, the stack is unwound as you go, the damage is done before you hit the exception [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[10],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-tricks-tips-tools"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-e","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":0,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}