Exceptions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csharpula csharp

    Exceptions

    Hello I got the following scenario:

    Getting exception from some code unit :

    catch (System.Excepti on ex)
    {
    throw new Exception("unab le to load file project" , ex);
    }


    This exception is being catched in the upper unit which called this code
    :

    catch (Exception ex)
    {
    Console.write ("error aaa")
    }


    I can see only the last console print and not the Inner exception. Is
    there any way to build my exceptios in a way that I will see the full
    exception without printing the inner one?
    Thank you



    *** Sent via Developersdex http://www.developersdex.com ***
  • Jon Skeet [C# MVP]

    #2
    Re: Exceptions

    On Mar 11, 3:50 pm, csharpula csharp <csharp...@yaho o.comwrote:

    <snip>
    This exception is being catched in the upper unit which called this code
    :
    >
    catch (Exception ex)
    {
    Console.write ("error aaa")
    >
    }
    >
    I can see only the last console print and not the Inner exception.
    Well the code above doesn't use *any* of the information about the
    exception, beyond the fact that it happened at all.
    Is there any way to build my exceptios in a way that I will see the full
    exception without printing the inner one?
    If you print ex.ToString(), you'll get all the stack traces and
    messages.

    Jon

    Comment

    Working...