Exception Handling Basics(caublestoneink.com)

submitted by jcaublejcauble(150) 2 years, 9 months ago

The basics of exception handling and getting good stack traces.

2 comments |category: |Views: 467

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by leedumondleedumond(2139) 2 years, 9 months ago 0

Sorry, but this is about the worse example of exception handling I have ever read. For an article called "Exception Handling Basics", it makes some HUGE and very "basic" errors.

First, the examples throw ArgumentNullException from methods that HAVE NO ARGUMENTS. This makes absolutely NO sense. This is pretty much "Basic" Exception Handling 101.

Second, there are catch(Exception) and empty catch blocks all over the place. You should never, EVER catch System.Exception. Another very "basic" no-no.

Sure, it does demonstrate what happens when you reset the call stack, which you shouldn't do. Unfortunately, the examples are so "basically" flawed it makes my teeth hurt.

Reply

posted by samdnpsamdnp(975) 2 years, 9 months ago 0

I agree that the article has some problems. A good place to learn about exception handling is in the BCL itself. You can see how that uses the ArgumentNullException, etc.

Reply

information Login or create an account to comment on this story