{"id":749,"date":"2014-05-08T22:57:37","date_gmt":"2014-05-08T22:57:37","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=749"},"modified":"2022-02-03T11:25:02","modified_gmt":"2022-02-03T17:25:02","slug":"advice-catching-exceptions-trick-mentor","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/","title":{"rendered":"Advice Catching Exceptions &#8211; a trick from a mentor"},"content":{"rendered":"<p>Using ASPX &#8211; we catch general exceptions &#8211; well some messages are too general. Here is some advice emailed to me from a mentor and friend Sjoerd.<\/p>\n<p>UPDATE: Be careful on what messages get thrown\/exposed to the final client. If there are open data that is sensitive &#8211; the advice below might bee too revealing.<\/p>\n<p>When catching errors, please make sure you bring back the following properties from the exception:<\/p>\n<ul>\n<li>Ex.StackTrace<\/li>\n<li>Ex.Message<\/li>\n<li>Ex.InnerException<\/li>\n<\/ul>\n<p>He included these links<\/p>\n<ul>\n<li><a style=\"font-style: normal;\" href=\"http:\/\/www.dailycoding.com\/Posts\/are_you_throwing_exceptions_correctly.aspx\">http:\/\/www.dailycoding.com\/Posts\/are_you_throwing_exceptions_correctly.aspx<\/a><\/li>\n<li><a style=\"font-style: normal;\" href=\"http:\/\/stackoverflow.com\/questions\/4272579\/how-to-print-full-stack-trace\">http:\/\/stackoverflow.com\/questions\/4272579\/how-to-print-full-stack-trace<\/a><\/li>\n<\/ul>\n<p>If you like, you can throw an exception on purpose and look at what the properties will return you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using ASPX &#8211; we catch general exceptions &#8211; well some messages are too general. Here is some advice emailed to me from a mentor and friend Sjoerd. UPDATE: Be careful on what messages get thrown\/exposed to the final client. If there are open data that is sensitive &#8211; the advice below might bee too revealing. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-749","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"Using ASPX &#8211; we catch general exceptions &#8211; well some messages are too general. Here is some advice emailed to me from a mentor and friend Sjoerd. UPDATE: Be careful on what messages get thrown\/exposed to the final client. If there are open data that is sensitive &#8211; the advice below might bee too revealing. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2014-05-08T22:57:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:25:02+00:00\" \/>\n<meta name=\"author\" content=\"Etienne Bley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Etienne Bley\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"Advice Catching Exceptions &#8211; a trick from a mentor\",\"datePublished\":\"2014-05-08T22:57:37+00:00\",\"dateModified\":\"2022-02-03T17:25:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/\"},\"wordCount\":125,\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/\",\"name\":\"Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"datePublished\":\"2014-05-08T22:57:37+00:00\",\"dateModified\":\"2022-02-03T17:25:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/advice-catching-exceptions-trick-mentor\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advice Catching Exceptions &#8211; a trick from a mentor\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\",\"name\":\"ELB Solutions.com Inc.\",\"description\":\"Bringing all your IT Pieces together\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\",\"name\":\"Etienne Bley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"caption\":\"Etienne Bley\"},\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/author\\\/etienne-bley\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/","og_locale":"en_US","og_type":"article","og_title":"Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.","og_description":"Using ASPX &#8211; we catch general exceptions &#8211; well some messages are too general. Here is some advice emailed to me from a mentor and friend Sjoerd. UPDATE: Be careful on what messages get thrown\/exposed to the final client. If there are open data that is sensitive &#8211; the advice below might bee too revealing. [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2014-05-08T22:57:37+00:00","article_modified_time":"2022-02-03T17:25:02+00:00","author":"Etienne Bley","twitter_misc":{"Written by":"Etienne Bley","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"Advice Catching Exceptions &#8211; a trick from a mentor","datePublished":"2014-05-08T22:57:37+00:00","dateModified":"2022-02-03T17:25:02+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/"},"wordCount":125,"articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/","url":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/","name":"Advice Catching Exceptions - a trick from a mentor - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"datePublished":"2014-05-08T22:57:37+00:00","dateModified":"2022-02-03T17:25:02+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/advice-catching-exceptions-trick-mentor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"Advice Catching Exceptions &#8211; a trick from a mentor"}]},{"@type":"WebSite","@id":"https:\/\/elbsolutions.com\/projects\/#website","url":"https:\/\/elbsolutions.com\/projects\/","name":"ELB Solutions.com Inc.","description":"Bringing all your IT Pieces together","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elbsolutions.com\/projects\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39","name":"Etienne Bley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","caption":"Etienne Bley"},"url":"https:\/\/elbsolutions.com\/projects\/author\/etienne-bley\/"}]}},"_links":{"self":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/comments?post=749"}],"version-history":[{"count":2,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":972,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/749\/revisions\/972"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}