Click here to Skip to main content
15,919,613 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 6:22
cstrader23215-Feb-08 6:22 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 6:32
cstrader23215-Feb-08 6:32 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:30
sitebuilderLuc Pattyn15-Feb-08 7:30 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:22
sitebuilderLuc Pattyn15-Feb-08 7:22 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 7:45
cstrader23215-Feb-08 7:45 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:49
sitebuilderLuc Pattyn15-Feb-08 7:49 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 10:15
cstrader23215-Feb-08 10:15 
GeneralRe: Exception information detail Pin
supercat918-Feb-08 6:16
supercat918-Feb-08 6:16 
Luc Pattyn wrote:
Example: if you have a mathematical algorithm and suddenly get a divide-by-zero,
it does not make sense to have that catched several method levels above it, since
at that level the caller would not be aware of the algorithm, what a zero-divide
would be, and how it should be remedied. Instead, you should catch it locally, and
try to organize things such that the method fails gracefully.


If I'm trying to do something like plot a graph of a user-specified function, what would be the preferred try/catch methodology for the expression evaluation? I know that one isn't supposed to use try/catch to just ignore errors, but if I get a divide-by-zero, domain error, or other such problem do I really care why the evaluation failed? I should regard the function value at that point as undefined (meaning that the points before and after should probably not be connected) but other than that I don't see much that a try/catch block could usefully do.

Ideally, one could divide exceptions from such a routine into three classes:

  1. Those whose failure should simply cause a particular value not to be plotted.
  2. Those whose failure should cause the remainder of the plotting to be skipped, since remaining points won't work any better.
  3. Those which should send an exception to outer functions, since something very bad is happening (heap management failure, etc.)

From a practical standpoint, though, I don't see any clean way to accomplish that if the function to be plotted will be supplied by the user. Unless the called function has defined explicit exception types for 'failure that's going to occur on all points' versus 'failure that may just occur on one point', I see no way for the outer function to know what to make of any inner exceptions.
GeneralRe: Exception information detail Pin
Luc Pattyn18-Feb-08 9:06
sitebuilderLuc Pattyn18-Feb-08 9:06 
GeneralNET 1.1 SMTP problem : "The transport failed to connect to the server." [modified] Pin
Stortman15-Feb-08 4:07
Stortman15-Feb-08 4:07 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Dave Kreskowiak15-Feb-08 4:30
mveDave Kreskowiak15-Feb-08 4:30 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 5:32
Stortman15-Feb-08 5:32 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Dave Kreskowiak15-Feb-08 5:49
mveDave Kreskowiak15-Feb-08 5:49 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 11:06
Stortman15-Feb-08 11:06 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 13:58
Stortman15-Feb-08 13:58 
GeneralOpening VS2005 Project in VS2008 Pin
plural15-Feb-08 3:11
plural15-Feb-08 3:11 
GeneralRe: Opening VS2005 Project in VS2008 Pin
Dave Kreskowiak15-Feb-08 4:26
mveDave Kreskowiak15-Feb-08 4:26 
GeneralRe: Opening VS2005 Project in VS2008 Pin
plural15-Feb-08 4:37
plural15-Feb-08 4:37 
QuestionTop most question? Pin
Benny_Lava15-Feb-08 2:35
Benny_Lava15-Feb-08 2:35 
GeneralRe: Top most question? Pin
Dave Kreskowiak15-Feb-08 4:23
mveDave Kreskowiak15-Feb-08 4:23 
GeneralRe: Top most question? Pin
Luc Pattyn15-Feb-08 6:08
sitebuilderLuc Pattyn15-Feb-08 6:08 
QuestionHardware interface from vb.net,c#,vb6. Pin
aamn115-Feb-08 2:18
aamn115-Feb-08 2:18 
GeneralRe: Hardware interface from vb.net,c#,vb6. Pin
Dave Kreskowiak15-Feb-08 4:15
mveDave Kreskowiak15-Feb-08 4:15 
General'UPGRADE_WARNING: Couldn't resolve default property of object Pin
sarat15-Feb-08 1:40
sarat15-Feb-08 1:40 
GeneralRe: 'UPGRADE_WARNING: Couldn't resolve default property of object Pin
Dave Kreskowiak15-Feb-08 4:10
mveDave Kreskowiak15-Feb-08 4:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.