public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Andrew Cagney <cagney@redhat.com>
Cc: frysk@sourceware.org
Subject: Re: fhpd vs RuntimeExceptions
Date: Wed, 14 Nov 2007 19:11:00 -0000	[thread overview]
Message-ID: <1195067447.3027.63.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <473B3108.4000203@redhat.com>

Hi Andrew,

On Wed, 2007-11-14 at 12:31 -0500, Andrew Cagney wrote:
> from the call; what about:
>   CLI.printError(String)
> and/or/...
>   CLI.printError(Exception)

You mean to replace CLI.addMessage() and do the user feedback directly
instead of stacking it in a Message queue and then replaying it? Yes,
that makes sense. The current setup does feel a little over-engineered.

[There is the issue that you don't have a strong connection to the
original Command executed by the user for which this is a response, but
we didn't have that in the case of the (add)Message constructs in the
first place, so that might not matter at this point. Since from the user
point of view the fhpd is single threaded and accepts just one command
at a time. It might matter in the future for the gui though since that
could be issuing multiple commands at the same time and then you want to
have a stronger tie between the issued command and the user response or
error message.]

> 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).

I don't think that is the right logic. There are also other
RuntimeExceptions like ArrayOutOfBoundsException, ArithmeticException,
IllegalArgumentException or NumberFormatException, etc. that don't have
empty messages, but that are real core bugs if they occur and "bubble
up" to the CLI. Just printing the message isn't enough information for
the user to see what really went wrong.

If the Exception is truly meant to convey information to the end user in
relation to a specific command it should be more explicitly communicated
than just by any generic RuntimeException.

Cheers,

Mark

  reply	other threads:[~2007-11-14 19:11 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
2007-11-14 19:11       ` Mark Wielaard [this message]
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=1195067447.3027.63.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=cagney@redhat.com \
    --cc=frysk@sourceware.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).