From: Andrew Cagney <cagney@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: frysk@sourceware.org
Subject: Re: fhpd vs RuntimeExceptions
Date: Wed, 14 Nov 2007 17:33:00 -0000 [thread overview]
Message-ID: <473B3108.4000203@redhat.com> (raw)
In-Reply-To: <1195054603.3027.40.camel@dijkstra.wildebeest.org>
Mark,
from the call; what about:
CLI.printError(String)
and/or/...
CLI.printError(Exception)
the "logic" deciding what to do with the exception; for instance if
Exception.getMessage() is null/empty then things are bad; dump the
back-trace; but otherwise just print the message (That should cover null
pointer exceptions).
Andrew
Mark Wielaard wrote:
> We quickly went over this on the meeting just now.
> Just a summary to see if I got it all.
>
> On Wed, 2007-11-14 at 09:44 -0500, Andrew Cagney wrote:
>
>> Mark Wielaard wrote:
>>
>>> While investigating some bugs I noticed that the fhpd sometimes swallows
>>> the RuntimeExceptions from the core (and there I thought all was
>>> fine...).
>>>
>> Just fyi, broadly the message stuff, at least for normal output, is
>> going away.
>>
>> The reason is that the cli alternates between using addMessage and
>> PrintWriter.print(...) for normal out; so I've been migrating stuff to
>> just do PrintWriter.print. But this leaves us still needing a way to
>> consistently report errors.
>>
>
> OK, good to know, I had only seen the Message variants in the code that
> I looked at. The (add)Message stuff had one benefit that it concentrated
> the generation of Messages so you can easily capture any exception
> causes, which may patch added. When using "raw" Printwriter calls you
> would need some way to capture and then report the errors indeed.
>
>
>>> This makes debugging the fhpd itself a little hard. I added a
>>> possible exception cause to the Message class and while I was at it
>>> added checks to make sure we don't present the user with an empty or
>>> null message (which is very uninformative). Currently we always print
>>> these possible exception causes when they are attached to a Message in
>>> CLI.flushMessages().
>>>
>> We were printing both the error and the stack, that looked terrible (the
>> number of times an exception occurs for legitimated reasons is
>> surprising); so they were turned off. Did this turn them back on?
>>
>
> The cases I looked at were things like:
> http://sourceware.org/bugzilla/show_bug.cgi?id=5286
> http://sourceware.org/bugzilla/show_bug.cgi?id=5267
> Where there was an internal RuntimeException without a message so you
> would just see Error: null or Error: "" without any extra info.
>
> In those cases when you have an internal RuntimeException you now attach
> a exception cause to the message (and currently always print it, but
> that can certainly be made optional - either with a command line option
> to fhpd when started up or by setting some internal variable - see help
> set).
>
> The main problem seems to be how to categorize RuntimeExceptions.
> Currently we are mixing internal ones, that should never occur and when
> they bubble up to the fhpd CLI level should really be reported and
> "expected" RuntimeExceptions that "mean" something at the fphd level and
> for which only the message might make sense.
>
> Cheers,
>
> Mark
>
>
next prev parent reply other threads:[~2007-11-14 17:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-14 14:27 Mark Wielaard
2007-11-14 14:45 ` Andrew Cagney
2007-11-14 15:27 ` Kris Van Hees
2007-11-14 15:36 ` Mark Wielaard
2007-11-14 17:33 ` Andrew Cagney [this message]
2007-11-14 19:11 ` Mark Wielaard
2007-11-15 17:01 ` Phil Muldoon
2007-11-15 17:42 ` Mark Wielaard
2007-11-15 18:19 ` Phil Muldoon
2007-11-15 18:25 ` Sami Wagiaalla
2007-11-16 11:21 ` Mark Wielaard
2007-11-15 18:21 ` Sami Wagiaalla
2007-11-15 20:33 ` Kris Van Hees
2007-11-16 10:12 ` Mark Wielaard
2007-11-15 18:46 ` Andrew Cagney
2007-11-16 10:15 ` Mark Wielaard
2007-11-15 20:41 ` Kris Van Hees
2007-11-15 22:11 ` Phil Muldoon
2007-11-15 23:09 ` Kris Van Hees
2007-11-16 10:42 ` Mark Wielaard
2007-11-15 18:04 ` Mark Wielaard
2007-11-15 18:22 ` Phil Muldoon
2007-11-15 19:06 ` Andrew Cagney
2007-11-16 10:28 ` Mark Wielaard
2007-11-16 14:32 ` Andrew Cagney
2007-11-26 10:18 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=473B3108.4000203@redhat.com \
--to=cagney@redhat.com \
--cc=frysk@sourceware.org \
--cc=mark@klomp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).