1
vote
3answers
230 views

Exception when logging exception: is it correct to ignore them?

My question is specific to php, but i think it can be useful in other languages. I log into a table all the exception a code can throw: try{ //Some code } catch (Exception $e) { $log = new ...
0
votes
2answers
327 views

Is storing stack traces in database recommended?

The current system I am working on goes through a set of documents & performs some logic using the metadata of the document. If the metadata of a document is fishy..it throws an exception. The ...
1
vote
3answers
94 views

Communicating details of method result?

I have code like this (pseudocode) foreach(Box box in boxes) { if(boxFilter.PassesFilter(box)) { // do something useful } else { Log.Log(format("Box %s was rejected", ...
16
votes
6answers
35k views

Why doesn't “object reference not set to an instance of an object” tell us which object?

We're launching a system, and we sometimes get the famous exception NullReferenceException with the message Object reference not set to an instance of an object. However, in a method where we have ...
13
votes
2answers
993 views

Is it more sensible to log exceptions in a catch-all or in a base exception class?

I'm in the process of refactoring a fairly large web app. One of the major issues is inconsistent error handling and I'm trying to come up with a sensible strategy. I've created a custom error ...
12
votes
6answers
2k views

What's the best way to manage error logging for exceptions?

Introduction If an error occurs on a website or system, it is of course useful to log it, and show the user a polite message with a reference code for the error. And if you have lots of systems, you ...
11
votes
5answers
665 views

When to start writing Exception Handling, Logging

When do you start writing your Exception Handling Code? When do you start writing Logging Statements. For the purpose of elaborating this question, let us assume that we are on .NET platform with ...
4
votes
2answers
388 views

How much logging should I do at production for SQLExcpetions?

I'm writing a small database-centric application in Java Swing that will be used internally in a small company. I haven't much experience with developing production-level applications. I don't use an ...