Retrace will reach End of Life on March 31, 2027. Click here to learn more.

Finding Hidden Exceptions in Your Application with Prefix

By: mwatson
  |  December 5, 2016
Finding Hidden Exceptions in Your Application with Prefix

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:

  1. Unhandled – the user got a 500 error and your app blew up πŸ™
  2. Logged – your code “caught” the error and logged it somewhere
  3. Hidden – your code “caught” the error and it is never logged

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.

View Unhandled Exceptions with Prefix

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.

500-error

View Logged Exceptions with Prefix

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 log4net, Serilog, or NLog.

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 Retrace.

Viewing Hidden Exceptions with Prefix

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.

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 trying to convert a value to an integer, something easily avoided with a int.TryParse().

nopcommerce-error2

Get the Whole Story with Errors & Logs Combined

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.

Example showing debug logging, exception, 2 SQL queries, and a redis call.

prefix-error-log-full-trace-2

 

Prefix is free. Download it today and get started with your bug hunt!

If an exception happens and there is no code there to catch it, does it still bug you? #nerdHumor

 

Get Prefix Power on a server!
Get Prefix Power on a server!


Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

Learn More
togel slot situs toto pucuk4d agb99 togel toto slot toto togel toto slot indobet situs toto toto slot toto slot toto slot toto toto situs toto toto slot slot depo 10k toto togel 8kuda4d toto judi bola kenangan4d toto situs toto toto toto toto situs toto toto toto slot bobatoto daftar situs toto logototo situs toto situs toto toto bydplay patentoto situs toto slot 4D situs toto leon188 situs toto slot gacor terbaru toto toto slot toto situs toto situs toto MORFINTOTO slot4d ilmutoto toto mix parlay bayitoto pasarbola toto toto toto toto ilmutoto toto toto mawar800 login popotogel prize hongkong malam ini toto slot gacor joker11 toto slot pucuk4d lingkartoto lingkartoto Pucuk4D Login PREMANTOTO UGSLOT slot gacor slot gacor slot gacor AMANAHTOTO toto ilmutoto ILMUTOTO 8kuda4d titi4d lingkartoto lingkartoto toto situs toto ilmutoto toto slot gacor rp888 https://foundvinylrecords.com/ depo 5k slot gacor toto slot gacor toto mataramtoto toto panen100 semibola slot gacor Pakde4D situs gacor MySlot188 SlotPoker188