Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.saix.net!news.saix.net.POSTED!not-for-mail NNTP-Posting-Date: Sun, 11 Dec 2011 02:46:18 -0600 Newsgroups: comp.lang.java.programmer Subject: Re: toward null-safe cookie cutter Comparators References: <22790268.15.1321806216236.JavaMail.geo-discussion-forums@prgt40> <9e8b681f-055f-4588-9ef6-3702322b4d3e@c4g2000vbh.googlegroups.com> <2113828.215.1321914010550.JavaMail.geo-discussion-forums@prlm15> From: ilAn Date: Sun, 11 Dec 2011 10:46:29 +0200 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) Cancel-Lock: sha1:FLB4FViC8XFArHDepO6ki/a30MQ= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Forwarded: by - (DeleGate/9.9.1) Lines: 64 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-nTIPvH6kIKoZa0LMHGrtffF/g7z6ypYpuuXxnalAmxxCObM+1h+orPJ7ui8bYD/b1hF/JeNZ/HljbzE!JaUl+E3RqV+Y2FAazPjy0gs3AWJHk1Y/oc5lAzIDR1OOIc4WkRmYZ0M= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3956 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10654 Arved Sandstrom writes: > On 11-12-10 01:47 PM, ilAn wrote: >> Wanja Gayk writes: > > Did you (ilAn) read the very last bit in Jim Shore's PDF, where he talks > about global exception handlers in production? *This* is what Wanja was > getting at, and I myself espouse this approach also. Yes I did. I was not sure that was what Wanja was getting at... Is it Wanja? It seemed Wanja was saying that the codebase he/she is working with nulls are commonly passed around if data was not "correct"; potentially causing a null pointer exception somewhere else in the codebase... and then just throwing that null pointer; and not catching it as early as possible and replacing it with an Exception that contains some state information and context for that Null Pointer. Wanja, did I misunderstand you? > > "Fail fast" means not attempting to handle a problem that cannot be > handled at runtime. No catch-all exception handlers, no dubious > defaults. Be aware of what cannot be handled (configuration file not > found, unexpected NPE, etc) and pass it up immediately to a global > exception handler and either (1) stop the program (development, maybe > test) or (2) stop the individual task and provide help as to what to do > next (production). > > Handling locally - what you've misidentified as "fail fast" - is > appropriate only for expected exceptions that can actually be sensibly > handled. You are assuming I have misidentified something. But I guess by assuming that, you get a suitable springboard to reiterate what was in the article. A useful rhetorical trick I suppose. > > I've helped revamp a number of enterprise web applications to this > global exception handler model, and now rather than users seeing nasty > exception traces or virtually non-reproducible problem behaviour they > get a short but sweet error page that supplies screenshot info they can > paste into the defect tracking system before they call ops support. The > details are also logged. I never suggested otherwise. In fact why would anyone suggest otherwise? You don't need to turn me into a scarecrow to make your arguments and describe how you revamp enterprise web applications so well. I believe you are excellent developer; you don't need to insult me to prove that. > > AHS -- ilAn