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
T

taoklerks

@taoklerks
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Catch an Exception... then throw it?
    T taoklerks

    To your second example, the easier solution would be not to have a "general" catch block at all, right?

    try
    {
    // code that may throw exception here
    }
    catch(SQLException sqlex)
    {
    //Handle this exception here
    //Don't re-throw the exception.
    //Other exceptions will remain uncaught.
    }

    On the other hand, the opposite really does require a rethrow:

    try
    {
    // code that may throw exception here
    }
    catch(SQLException sqlex)
    {
    //We really want to rethrow just that exception for some reason.
    throw;
    }
    catch
    {
    //Whereas for everything else, we want to handle the exception here...
    }

    The Weird and The Wonderful csharp question
  • Login

  • Don't have an account? Register

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