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


Groups > comp.lang.java.programmer > #3909

Re: streaming problem and thread freeze

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: streaming problem and thread freeze
Date 2011-05-10 04:47 -0700
Organization A noiseless patient Spider
Message-ID <iqb8lf$1r1$1@dont-email.me> (permalink)
References <005a9e79-36fe-4bf1-aa1d-bda3a5aaebf2@glegroupsg2000goo.googlegroups.com> <iq9ai7$t2s$1@dont-email.me> <iqabig$i1u$1@lust.ihug.co.nz>

Show all headers | View raw


On 5/9/2011 8:31 PM, Lawrence D'Oliveiro wrote:
> In message<iq9ai7$t2s$1@dont-email.me>, Daniele Futtorovic wrote:
>
>> Secondly, although it is only a minor thing and only my personal
>> opinion, this:
>>
>>     } catch (IOException ex) {
>>       log.severe(ex.getMessage());
>>     }
>>
>> is a *very* bad idea. Log the full stack.
>
> It would be so much easier if you could simply not bother to catch the
> exception at all, and let your program crash with a full stack trace.


Partially correct.  If it's a small example program, or if it's only 
going to be used by developers or other folks who could make use of a 
stack trace, then sure, just throwing the error often works.

Many times however that does not work, and then you have to catch the 
error, log it, and then possibly rethrow with a different exception that 
some higher level code is able to catch.  Or you can skip logging it 
here, if you re-throw and you know the higher level code will log it. 
It takes about 20% art and about 80% prior-planning, but it's not hard 
to work out ways to handle errors and logging in any give subsystem.

For end users, the best way imo is to have main catch all errors, then 
log and attempt to upload it to a central site.  This avoids having to 
ask the users to dig through logs, up load them, or interpret them. 
It's just easier on everybody, yourself included.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

streaming problem and thread freeze Fly <flavio80@gmail.com> - 2011-05-09 07:56 -0700
  Re: streaming problem and thread freeze Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-05-09 20:08 +0200
    Re: streaming problem and thread freeze Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-05-10 15:31 +1200
      Re: streaming problem and thread freeze markspace <-@.> - 2011-05-10 04:47 -0700
      Re: streaming problem and thread freeze Lew <noone@lewscanon.com> - 2011-05-10 08:52 -0400
      Re: streaming problem and thread freeze Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-05-10 21:17 +0200
        Re: streaming problem and thread freeze Lew <noone@lewscanon.com> - 2011-05-10 17:26 -0400
          Re: streaming problem and thread freeze Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-05-11 18:55 +0200
        Re: streaming problem and thread freeze Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-05-11 14:06 +1200
          Re: streaming problem and thread freeze Lew <noone@lewscanon.com> - 2011-05-11 09:02 -0400

csiph-web