RE: AccessViolationException. Can you continue at all after
that? In the
general case, probably not. In a particular case: possibly;
if so, you
should be explicitly catching it only after you've fully
tested that
ignoring this exception is safe. catch{} or
catch(Exception){} suggests
you don't know.
Given that any operation that *could* be lengthy (like batch
processing or
looping through rows in a DataSet) is best done in a
background thread,
yes, a callback/event for exceptions that can be handled and
suggest
continuation requires some sort of action by the user (like
plugging the
network cable back in) is best handled by a decision from
the user (either
by MessageBox/Dialog or configuration option). That would
require lots of
infrastructure to handle correctly though; but would be a
very good
feature.
I didn't reply to any posts that included anything about
events/callbacks,
so, no I wasn't disagreeing (nor was previous post agreeing)
On Mon, 4 Dec 2006 00:44:57 +0800,
=?ISO-8859-1?Q?S=E9bastien_Lorion?=
<sebastien.lorion GMAIL.COM> wrote:
>I totally agree that ignoring exceptions as shown in
original post is
>bogus. That said, raising an event or calling a provided
callback
>looks to me like a valid way to handle errors when doing
certain
>tasks. Examples:
>
>1- doing a batch file copy operation
>2- searching for files (you really want to stop the
whole thing on an
>AccessViolationException?)
>3- doing a batch update on a database where problematic
records will
>be dealt with later (catching *some* exceptions is
appropriate here
>thought, such as the ones you mention)
>
>For 1 and 2, the application using your class might want
to display a
>dialog to the user asking him if he wants to ignore,
retry, cancel,
>etc.
>
>Are you disagreeing with that ?
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|