0

Various analytics tools will track the number of handled and unhandled exceptions (crashes) that happen in an app. This obviously helps us find problems we didn't know existed and will fix it.

Quite often, exceptions happen in try-catch blocks and are handled, but in many cases they still are situations that should not arise.

Should I keep tracking these exceptions in my analytics ?

On one side, I think yes, of course. The problem still persists, its handled (or sometimes even silenced...), but the reason its happening is still very much there and should be dealt with.

On the other side, I think no. We've already added the safety net we deemed sufficient and we know the client will never allow time to actually fix bugs. So this data is just cluttering our crash logs more than anything now.

My question is :

  • Should someone track handled exceptions in analytics in general? Even if its handled, I can see reasons to track them and not track them. What is best practice? Or is there something else to do entirely?
1

On the other side, I think no. We've already added the safety net we deemed sufficient and we know the client will never allow time to actually fix bugs. So this data is just cluttering our crash logs more than anything now.

I agree with your explanation up until this point. The purpose of tracking/logging is not to provide a list of "things the customer wants to have fixed". You shouldn't omit it from the list just because you expect the customer to not want to fix the issue.

Very simply put, how are you going to remember that this is an issue, should the customer open up the budget for bugfixing in the future?

Or how are you going to deal with a second customer who buys this product, who does offer a budget to fix the issue?

The assertion that the log should only reflect things the customer might want to pay to have fixed is simply not correct. "Things that are going wrong" and "things the customer want fixed" are not different names for the same thing. They are two very separate things.

Should someone track handled exceptions in analytics in general?

What is the point of analytics if you're willfully going to hide things from it?

There's a difference between e.g. filtering certain "known and ignored" messages from your view (which is fair enough) and not putting them on the list to begin with (which leads to incomplete analytics).

  • That's a really good point you've just made. Thanks man. Its a great answer – Gil Sand Feb 5 at 14:23
1

Generally ALL your exceptions should be handled, even if just to return a friendly error message or to keep your application running.

Also, you should never expect an exception (it's one of their 3 weapons) in normal operation.

Therefore, yes you do want to log and track them, raise alerts etc.

Edit - to clarify not expecting exceptions.

Say you have an api call to a third party. You know that the third party is unreliable and will drop 10% of requests. The advice from them is "just resend!"

Your normal code might raise an exception on a failed request. Although you know the internet is not 100% reliable you don't expect requests to fail and want to be alerted if they do.

Your special code for this api has some built in retry logic, Rather than throwing on each failure and handling the exception with a retry, the first 2 failures don't raise an exception at all and the third failure does.

This allows finer control over the exact retry conditions, keeps exception catching out of your logic and allows a consistent "log all exceptions" exception handling logic.

  • you should never expect an exception, I somewhat disagree with you here, when in the context of backend requests, I'll always expect a 500 or some parsing exceptions because some idiot changed the data format without mentioning it to us. But you mean it as "don't catch something you know will happen 100% of the time", I assume ? – Gil Sand Feb 5 at 9:35
  • 3
    heh, I guess i mean in perfect world you don't expect idiots to break things. Or at least you want to be alerted when they do :) – Ewan Feb 5 at 9:54
  • "Also, you should never expect an exception in normal operation" does this argument really need to happen again? – whatsisname Feb 5 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.