Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 88102 invoked from network); 10 Jan 2011 15:11:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jan 2011 15:11:48 -0000 Received: (qmail 39538 invoked by uid 500); 10 Jan 2011 15:11:48 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 39326 invoked by uid 500); 10 Jan 2011 15:11:47 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 39305 invoked by uid 99); 10 Jan 2011 15:11:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 15:11:46 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.179.121.38] (HELO fep18.mx.upcmail.net) (62.179.121.38) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 15:11:37 +0000 Received: from edge02.upcmail.net ([192.168.13.237]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20110110151113.MPCZ1353.viefep18-int.chello.at@edge02.upcmail.net> for ; Mon, 10 Jan 2011 16:11:13 +0100 Received: from asgard.felixknecht.ch ([84.74.100.246]) by edge02.upcmail.net with edge id trBB1f03a5JxopQ02rBD5h; Mon, 10 Jan 2011 16:11:13 +0100 X-SourceIP: 84.74.100.246 Message-ID: <4D2B218F.8020202@apache.org> Date: Mon, 10 Jan 2011 16:11:11 +0100 From: Felix Knecht Reply-To: felixk@apache.org User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Exception handling References: <4D2B17E6.2080502@gmail.com> In-Reply-To: <4D2B17E6.2080502@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=tMVj8KYobzzX0EiRnC7vY2isLrCxFvdg4RrHWPZXwJ0= c=1 sm=0 a=pXoq77xVGrQA:10 a=8nJEP1OIZ-IA:10 a=N5q338wrqFSifhRDva4A:9 a=NhBGoEEvG5LcCumL-3wA:7 a=4UVyhKiYzQqXSjPV76UF1UdDH1AA:4 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 > Since I started to work on the server almost 6 years ago, I was > convinced that writing StackTraces in the logs was a error, as it could > fill the logs very quickly, and make them grow so fast that any valuable > message could be buried into millions of lines of stack trace. If errors are swallowed or converted into other Exceptions it's always not easy to trigger the real error cause. That's why I get used to log an error when catching it - even when throwing afterwards a transformed error. What about having a dedicated log file only for errors? Like this the common log file would still be readable. > > Right now, I think that I would rather have those stackTraces instead of > spending hours debugging the server or adding some temporary > e.printStackTraces in some random places. Typically, today, I tracked > down a NPE which was generated by a error message using a null reference > to inform the client about the cause of the error. Isn't it ironical > that trying to give back some info when some error occurred you get a > NPE ? No. In fact, it happens all the time, but we aren't protected > against such mistakes. > > Now, I would suggest we add some handling of such exception at the > higher level, ie in core-session. +1 Overall it would be helpfull if we can still get the causing error and it's location even when mapping and/or swallowing errors for various reasons. Java5 can be helpfull as Exception can more and more be used in a cascading way.