Bug#472053: Fwd: [Rxtx] gnu.io.RXTXPort discards exception silently if initialization fails

Scott Howard showard314 at gmail.com
Wed Jun 23 21:17:28 UTC 2010


---------- Forwarded message ----------
From: Steffen DETTMER <Steffen.DETTMER at ingenico.com>
Date: Wed, Jun 23, 2010 at 12:35 PM
Subject: Re: [Rxtx] gnu.io.RXTXPort discards exception silently if
initialization fails
To: rxtx at qbang.org


* Kustaa Nyholm wrote on Wed, Jun 23, 2010 at 12:55 +0300:
> > Wouldn't it be better to store the exception in a member and
> > throw it when needing Zystem (e.g. in new or open)
>
> I'm of the fail-fast school of thought so I think it should be
> reported and re-thrown as it happens, not later.

Ahh yes, I agree, in general it is much better to fail quick,
loud and verbosely, right!

However, if this is a static { } block, AFAIK it is not defined
when it will be executed (Before application start? Or later,
when loading the class later? Or when using it first time?).

If the exception would be thrown before main() is called, I think
it is difficult to catch it. I think some general global hook
must be used to do so.

Simpler to handle, if it is thrown when invocating some function,
then it can be caught by try { } catch.
(or am I wrong or outdated?)

oki,

Steffen




About Ingenico: Ingenico is a leading provider of payment solutions,
with over 15 million terminals deployed in more than 125 countries.
Its 2,850 employees worldwide support retailers, banks and service
providers to optimize and secure their electronic payments solutions,
develop their offer of services and increase their point of sales
revenue. More information on http://www.ingenico.com/.
 This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.
 P Please consider the environment before printing this e-mail


_______________________________________________
Rxtx mailing list
Rxtx at qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx





More information about the pkg-java-maintainers mailing list