Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Exception Handling

Exception Handling

Scheduled Pinned Locked Moved ASP.NET
questionlounge
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahithi
    wrote on last edited by
    #1

    Hi all, i have one doubt regarding exception handling statements sequence. we have various exceptions like.. System.ApplicationException System.ArgumentException System.ArgumentNullException System.ArithmeticException System.IO.FileNotFoundException System.IO.IOException ..................... .................... if we want to catch IO errors and some general errors in the same code ....then is there any sequence that we have to follow. i mean first catch block should handle only geneal exceptions, next catch block for IO errors... or we can use any order?? thanks, Rahi

    If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

    C 1 Reply Last reply
    0
    • R Rahithi

      Hi all, i have one doubt regarding exception handling statements sequence. we have various exceptions like.. System.ApplicationException System.ArgumentException System.ArgumentNullException System.ArithmeticException System.IO.FileNotFoundException System.IO.IOException ..................... .................... if we want to catch IO errors and some general errors in the same code ....then is there any sequence that we have to follow. i mean first catch block should handle only geneal exceptions, next catch block for IO errors... or we can use any order?? thanks, Rahi

      If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Rahithi wrote:

      if we want to catch IO errors and some general errors in the same code ....then is there any sequence that we have to follow

      You should start with the most specific exceptions first and move to the more general. You can work out which are specific and which are general by looking at the base class of each exception. The most general (and therefore last) exception is Exception.


      Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups