Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12680 > unrolled thread

Quick Error Handling Question

Started byNovice <novice@example..com>
First post2012-03-05 01:10 +0000
Last post2012-03-05 13:51 +0000
Articles 2 on this page of 22 — 10 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Quick Error Handling Question Novice <novice@example..com> - 2012-03-05 01:10 +0000
    Re: Quick Error Handling Question Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-03-04 17:20 -0800
      Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 20:29 -0500
        Re: Quick Error Handling Question Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-03-04 17:35 -0800
          Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 20:58 -0500
            Re: Quick Error Handling Question Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-03-04 18:11 -0800
              Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 21:42 -0500
                Re: Quick Error Handling Question Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-03-04 19:26 -0800
                  Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 22:44 -0500
                    Re: Quick Error Handling Question Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2012-03-04 21:20 -0800
                      Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 21:26 -0500
    Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 20:22 -0500
      Re: Quick Error Handling Question Lew <noone@lewscanon.com> - 2012-03-05 02:48 -0800
    Re: Quick Error Handling Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-04 21:01 -0500
      Re: Quick Error Handling Question Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-05 22:59 +0000
        Re: Quick Error Handling Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-05 19:55 -0400
          Re: Quick Error Handling Question Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-06 00:01 +0000
    Re: Quick Error Handling Question markspace <-@.> - 2012-03-04 19:13 -0800
      Re: Quick Error Handling Question Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-03-10 15:21 +0200
    Re: Quick Error Handling Question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-04 22:34 -0800
    Re: Quick Error Handling Question Roedy Green <see_website@mindprod.com.invalid> - 2012-03-05 02:25 -0800
    Re: Quick Error Handling Question Novice <novice@example..com> - 2012-03-05 13:51 +0000

Page 2 of 2 — ← Prev page 1 [2]


#12703

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-03-05 02:25 -0800
Message-ID<p159l79flbhsefk77sjein6gin5sj9cmjo@4ax.com>
In reply to#12680
On Mon, 5 Mar 2012 01:10:13 +0000 (UTC), Novice <novice@example..com>
wrote, quoted or indirectly quoted someone who said :

>Should I write stacktraces from my checked and unchecked exceptions to my 
>log? Or just assume that all stacktraces will be written to the console and 
>the console will always be accessible to everyone who needs it?

A stacktrace helps you figure out what caused an unexpected out of the
blue problem.  If it is just a missing file causing the trouble, the
stack track is probably superfluous.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
One of the most useful comments you can put in a program is 
"If you change this, remember to change ?XXX? too".
 

[toc] | [prev] | [next] | [standalone]


#12708

FromNovice <novice@example..com>
Date2012-03-05 13:51 +0000
Message-ID<XnsA00D5B2C823CBjpnasty@94.75.214.39>
In reply to#12680
Novice <novice@example..com> wrote in
news:XnsA00CCE30F52F5jpnasty@94.75.214.39: 

> I'm trying to learn more about Error Handling. I've read the Java
> Tutorial topic on it, as well as Bloch's Effective Java (2nd edition)
> tips on it. I've started on Robust Java by Stephen Stelting too. I
> know I'm going to have more questions later but one is bugging me
> right now and I'm not seeing it mentioned anywhere so let me ask now.
> 
> Should I write stacktraces from my checked and unchecked exceptions to
> my log? Or just assume that all stacktraces will be written to the
> console and the console will always be accessible to everyone who
> needs it? 
> 

Thanks to all who replied to my question.

Some of you already know this but for the sake of those who don't, this 
was essentially a followup to the lengthy "Aspect Questions?" thread from 
last week which started out as a general question about AspectJ but then 
mutated into a general discussion of logging (for the most part). We went 
over a lot of conceptual stuff and I got a lot of misconceptions sorted 
out. I'm trying to apply that new knowledge to my existing programs now 
and found that I couldn't see anything in what I was reading about error 
handling that said whether any attempt should be made to log stacktraces 
or whether I could safely assume that putting them on the console would 
be sufficient. This was very much intended to be a general "best 
practices" kind of question but perhaps that wasn't as clear as it could 
have been.

The main thing I've learned from your replies is that it is rarely wrong 
to log something that may be available from another source, even if it is 
redundant, and that it is probably NOT safe to assume that a console that 
might contain stacktraces is always going to be accessible to those who 
need it. I had anticipated the first from the other thread and suspected 
the second. Your confirmations were very helpful. 

Thanks again!

-- 
Novice

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.programmer


csiph-web