{"id":731,"date":"2011-02-11T11:32:38","date_gmt":"2011-02-11T16:32:38","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=731"},"modified":"2011-02-11T11:32:38","modified_gmt":"2011-02-11T16:32:38","slug":"exceptions-are-for-programming-errors","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=731","title":{"rendered":"Exceptions are for programming errors"},"content":{"rendered":"<p>You should catch errors but be very careful about swallowing it and not re-throwing the exception. <\/p>\n<p>I have seen this in certain projects where exceptions are swallowed and the developer of the offending code never even knows that this happened.<\/p>\n<p>So months can go by without any testing, you are doing early testing &#8230; right?!&#8230; and then one day, you get a bug report that just doesn&#8217;t make sense.<\/p>\n<p>So, in my case, where the exception is being eaten up by the host application, I can actually break on objc_exception_throw in GDB, which, by the way, you can also do this using the UI in Xcode to stop on exceptions.<br \/>\n<a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/objc_breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/objc_breakpoint.png\" alt=\"This is Run menu from Xcode 3.2.4\" title=\"objc_breakpoint\" width=\"328\" height=\"596\" class=\"alignleft size-full wp-image-734\" srcset=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/objc_breakpoint.png 328w, https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/objc_breakpoint-165x300.png 165w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/a><\/p>\n<p><\/p>\n<p><a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/cpp_breakpoint.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/cpp_breakpoint.png\" alt=\"This is Run-&gt;Manage Breakpoints menu from Xcode 3.2.4\" title=\"cpp_breakpoint\" width=\"354\" height=\"156\" class=\"alignleft size-full wp-image-733\" srcset=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/cpp_breakpoint.png 354w, https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/02\/cpp_breakpoint-300x132.png 300w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You should catch errors but be very careful about swallowing it and not re-throwing the exception. I have seen this in certain projects where exceptions are swallowed and the developer of the offending code never even knows that this happened. So months can go by without any testing, you are doing early testing &#8230; right?!&#8230; &#8230; <a title=\"Exceptions are for programming errors\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=731\" aria-label=\"Read more about Exceptions are for programming errors\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[191,506],"class_list":["post-731","post","type-post","status-publish","format-standard","hentry","category-coding","tag-exceptions","tag-xcode"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=731"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}