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
S

Sean Sterling

@Sean Sterling
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dreaming of the code you debug...
    S Sean Sterling

    oh thank god, I thought I was the only one who's brain went to those weird places in normal daily life after long coding/debugging sessions! +5

    The Lounge com debugging question

  • Catch an Exception... then throw it?
    S Sean Sterling

    I'd also like to point out that of all the post I read in this thread, the parent to this post is the only one that was actually rethrowing the exception. Everyone else was repackaging the exception then throwing the repackaged exception which usually has the unintended consequence of losing the stack on the throw. Using the method the parent used ("throw" without a exception type reference) rethrows the last exception, full stack spool and all. i.e. Good:

    try
    {
    // code that may throw exception here
    }
    catch(Exception ex)
    {
    // error logging here
    // re-throw the exception, the stack stays safe.
    throw;
    }

    Bad:

    try
    {
    // code that may throw exception here
    }
    catch(Exception ex)
    {
    // error logging here
    // re-package the exception then throw it
    // probably losing the stack along the way
    throw ex;
    }

    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