{"id":6577,"date":"2016-12-05T13:35:36","date_gmt":"2016-12-05T13:35:36","guid":{"rendered":"https:\/\/stackify.com\/?p=6577"},"modified":"2023-08-17T08:17:07","modified_gmt":"2023-08-17T08:17:07","slug":"hidden-exceptions-prefix","status":"publish","type":"post","link":"https:\/\/stackify.com\/hidden-exceptions-prefix\/","title":{"rendered":"Finding Hidden Exceptions in Your Application with Prefix"},"content":{"rendered":"<p><a href=\"https:\/\/stackify.com\/prefix\" target=\"_blank\" rel=\"noopener noreferrer\">Prefix<\/a> enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more.&nbsp;One of the best features of Prefix is its ability to&nbsp;see all of the exceptions that are occurring in your code.<\/p>\n<p><strong>There are 3 types of exceptions:<\/strong><\/p>\n<ol>\n<li><a href=\"https:\/\/stackify.com\/catch-unhandled-exceptions-csharp\/\">Unhandled<\/a> &#8211; the user got a 500 error and your app blew up&nbsp;\ud83d\ude41<\/li>\n<li>Logged &#8211; your code &#8220;caught&#8221; the error and <a href=\"https:\/\/stackify.com\/error-monitoring\/\">logged it somewhere<\/a><\/li>\n<li>Hidden &#8211; your code &#8220;caught&#8221; the error and it is never logged<\/li>\n<\/ol>\n<p><em>Please note that, depending on if you are using .NET or Java, the functionality and potential configuration needed for errors and logs could be slightly different.<\/em><\/p>\n<h3>View Unhandled Exceptions with Prefix<\/h3>\n<p>Prefix will automatically show you all exceptions from a web request that abruptly ends in an exception. In this example below you can see the full stack trace and that the request ended with a 500 error.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6578\" src=\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error.png\" alt=\"500-error\" width=\"1487\" height=\"643\"><\/p>\n<h3>View Logged Exceptions with Prefix<\/h3>\n<p>If you are using Java, Prefix will automatically show any exception that is logged to log4j or logback. For .NET, you will need to follow the directions in our docs to add the Stackify log appender to your app for <a href=\"https:\/\/stackify.com\/log4net-guide-dotnet-logging\/\">log4net<\/a>, Serilog, or NLog.<\/p>\n<p>We highly recommend always using a common logging framework for your errors and logs. This abstracts away how you do logger from any single implementation and makes it easy to direct your log data to various targets like a file on disk or log management product like <a href=\"https:\/\/stackify.com\/retrace\" target=\"_blank\" rel=\"noopener noreferrer\">Retrace<\/a>.<\/p>\n<h3>Viewing Hidden Exceptions with Prefix<\/h3>\n<p>For .NET only, Prefix is able to collect every exception that is ever thrown. In .NET these are sometimes called first chance exceptions. These are the types of exceptions that are sometimes caught deep within code bases and thrown away.<\/p>\n<p>A good example of a hidden exception is this error from nopCommerce, which is a popular open source .NET ecommerce engine. It throws an exception on every page load&nbsp;trying to convert a value to an integer, something easily avoided with a int.TryParse().<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6581\" src=\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/nopcommerce-error2.png\" alt=\"nopcommerce-error2\" width=\"1714\" height=\"207\"><\/p>\n<h3>Get the Whole Story with Errors &amp; Logs Combined<\/h3>\n<p>One of the coolest features about Prefix and Retrace both is the ability to see all of your logs (and errors) for a single web request together. Logs combined with SQL queries, HTTP calls, and many other common dependencies, makes understanding what your code is doing much easier.<\/p>\n<p><em>Example showing debug logging, exception, 2 SQL queries, and a redis call.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6583\" src=\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/prefix-error-log-full-trace-2.png\" alt=\"prefix-error-log-full-trace-2\" width=\"1701\" height=\"983\"><\/p>\n<p>&nbsp;<\/p>\n<h2>Prefix is free. <a href=\"https:\/\/stackify.com\/prefix\" target=\"_blank\" rel=\"noopener noreferrer\">Download it today<\/a> and get started with your bug hunt!<\/h2>\n<p>If an exception happens and there is no code there to catch it, does it still bug you? #nerdHumor<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/cta-redirect.hubspot.com\/cta\/redirect\/207384\/40252f15-3dae-4d33-8bff-ffbeaac88942\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" id=\"hs-cta-img-40252f15-3dae-4d33-8bff-ffbeaac88942\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/207384\/40252f15-3dae-4d33-8bff-ffbeaac88942.png\" alt=\"Get Prefix Power on a server!\"><\/a><br \/>\n<a href=\"http:\/\/cta-redirect.hubspot.com\/cta\/redirect\/207384\/c7d9d886-6812-4ac9-9c37-3a4bd21e9649\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" id=\"hs-cta-img-c7d9d886-6812-4ac9-9c37-3a4bd21e9649\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/207384\/c7d9d886-6812-4ac9-9c37-3a4bd21e9649.png\" alt=\"Get Prefix Power on a server!\"><\/a><br \/>\n<span id=\"hs-cta-wrapper-c7d9d886-6812-4ac9-9c37-3a4bd21e9649\" class=\"hs-cta-wrapper\"><br \/>\n<\/span><br \/>\n<!-- end HubSpot Call-to-Action Code --><!--de74bdca--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more.&nbsp;One of the best features of Prefix is its ability to&nbsp;see all of the exceptions that are occurring in your code. There are 3 types of exceptions: Unhandled [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":38603,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[52,34],"class_list":["post-6577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-developer-tips","tag-developer-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v25.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Finding Hidden Exceptions in Your Application with Prefix - Stackify<\/title>\n<meta name=\"description\" content=\"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. &amp; One of the best features of Prefix is its ability to &amp; see all of the exceptions that are occurring in your code. There are 3 types of exceptions:\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Finding Hidden Exceptions in Your Application with Prefix - Stackify\" \/>\n<meta property=\"og:description\" content=\"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. &amp; One of the best features of Prefix is its ability to &amp; see all of the exceptions that are occurring in your code. There are 3 types of exceptions:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\" \/>\n<meta property=\"og:site_name\" content=\"Stackify\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Stackify\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-05T13:35:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-17T08:17:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"210\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matt Watson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stackify\" \/>\n<meta name=\"twitter:site\" content=\"@stackify\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matt Watson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\"},\"author\":{\"name\":\"Matt Watson\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/d02850a3ac13c2579469b3d0df48a845\"},\"headline\":\"Finding Hidden Exceptions in Your Application with Prefix\",\"datePublished\":\"2016-12-05T13:35:36+00:00\",\"dateModified\":\"2023-08-17T08:17:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\"},\"wordCount\":460,\"publisher\":{\"@id\":\"https:\/\/stackify.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg\",\"keywords\":[\"developer tips\",\"developer tools\"],\"articleSection\":[\"Developer Tips, Tricks &amp; Resources\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\",\"url\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\",\"name\":\"Finding Hidden Exceptions in Your Application with Prefix - Stackify\",\"isPartOf\":{\"@id\":\"https:\/\/stackify.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg\",\"datePublished\":\"2016-12-05T13:35:36+00:00\",\"dateModified\":\"2023-08-17T08:17:07+00:00\",\"description\":\"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. & One of the best features of Prefix is its ability to & see all of the exceptions that are occurring in your code. There are 3 types of exceptions:\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/stackify.com\/hidden-exceptions-prefix\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage\",\"url\":\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg\",\"contentUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg\",\"width\":700,\"height\":210},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/stackify.com\/#website\",\"url\":\"https:\/\/stackify.com\/\",\"name\":\"Stackify\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/stackify.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/stackify.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/stackify.com\/#organization\",\"name\":\"Stackify\",\"url\":\"https:\/\/stackify.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png\",\"contentUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png\",\"width\":1377,\"height\":430,\"caption\":\"Stackify\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Stackify\/\",\"https:\/\/x.com\/stackify\",\"https:\/\/www.instagram.com\/stackify\/\",\"https:\/\/www.linkedin.com\/company\/2596184\",\"https:\/\/www.youtube.com\/stackify\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/d02850a3ac13c2579469b3d0df48a845\",\"name\":\"Matt Watson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/51c331d566bab0683ebf28ba58bdc860?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/51c331d566bab0683ebf28ba58bdc860?s=96&d=mm&r=g\",\"caption\":\"Matt Watson\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Finding Hidden Exceptions in Your Application with Prefix - Stackify","description":"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. & One of the best features of Prefix is its ability to & see all of the exceptions that are occurring in your code. There are 3 types of exceptions:","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:\/\/stackify.com\/hidden-exceptions-prefix\/","og_locale":"en_US","og_type":"article","og_title":"Finding Hidden Exceptions in Your Application with Prefix - Stackify","og_description":"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. & One of the best features of Prefix is its ability to & see all of the exceptions that are occurring in your code. There are 3 types of exceptions:","og_url":"https:\/\/stackify.com\/hidden-exceptions-prefix\/","og_site_name":"Stackify","article_publisher":"https:\/\/www.facebook.com\/Stackify\/","article_published_time":"2016-12-05T13:35:36+00:00","article_modified_time":"2023-08-17T08:17:07+00:00","og_image":[{"width":700,"height":210,"url":"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg","type":"image\/jpeg"}],"author":"Matt Watson","twitter_card":"summary_large_image","twitter_creator":"@stackify","twitter_site":"@stackify","twitter_misc":{"Written by":"Matt Watson","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/#article","isPartOf":{"@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/"},"author":{"name":"Matt Watson","@id":"https:\/\/stackify.com\/#\/schema\/person\/d02850a3ac13c2579469b3d0df48a845"},"headline":"Finding Hidden Exceptions in Your Application with Prefix","datePublished":"2016-12-05T13:35:36+00:00","dateModified":"2023-08-17T08:17:07+00:00","mainEntityOfPage":{"@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/"},"wordCount":460,"publisher":{"@id":"https:\/\/stackify.com\/#organization"},"image":{"@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage"},"thumbnailUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg","keywords":["developer tips","developer tools"],"articleSection":["Developer Tips, Tricks &amp; Resources"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/","url":"https:\/\/stackify.com\/hidden-exceptions-prefix\/","name":"Finding Hidden Exceptions in Your Application with Prefix - Stackify","isPartOf":{"@id":"https:\/\/stackify.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage"},"image":{"@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage"},"thumbnailUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg","datePublished":"2016-12-05T13:35:36+00:00","dateModified":"2023-08-17T08:17:07+00:00","description":"Prefix enables developers to easily see what their code is doing as they write and test their code, including SQL queries, HTTP calls, errors, logs, and much more. & One of the best features of Prefix is its ability to & see all of the exceptions that are occurring in your code. There are 3 types of exceptions:","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stackify.com\/hidden-exceptions-prefix\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/hidden-exceptions-prefix\/#primaryimage","url":"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg","contentUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2016\/12\/500-error-feature.jpg","width":700,"height":210},{"@type":"WebSite","@id":"https:\/\/stackify.com\/#website","url":"https:\/\/stackify.com\/","name":"Stackify","description":"","publisher":{"@id":"https:\/\/stackify.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stackify.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/stackify.com\/#organization","name":"Stackify","url":"https:\/\/stackify.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/#\/schema\/logo\/image\/","url":"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png","contentUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png","width":1377,"height":430,"caption":"Stackify"},"image":{"@id":"https:\/\/stackify.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Stackify\/","https:\/\/x.com\/stackify","https:\/\/www.instagram.com\/stackify\/","https:\/\/www.linkedin.com\/company\/2596184","https:\/\/www.youtube.com\/stackify"]},{"@type":"Person","@id":"https:\/\/stackify.com\/#\/schema\/person\/d02850a3ac13c2579469b3d0df48a845","name":"Matt Watson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/51c331d566bab0683ebf28ba58bdc860?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51c331d566bab0683ebf28ba58bdc860?s=96&d=mm&r=g","caption":"Matt Watson"}}]}},"_links":{"self":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts\/6577"}],"collection":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/comments?post=6577"}],"version-history":[{"count":0,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts\/6577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/media\/38603"}],"wp:attachment":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/media?parent=6577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/categories?post=6577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/tags?post=6577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}