For example, in one place…
//---------------a
try
{
// some network call
}
catch(WebException we)
{
throw new MyCustomException("some message ....", we);
}
…and in another place…
//--------------b
try
{
// invoke code above
}
catch(MyCustomException we)
{
Debug.Writeline(we.stacktrace); // <----------------
}
The stacktrace I print, it only start from a to b,
it doesnt include the inner stacktrace from the WebException.
How can I print all the stacktrace???
I usually use the
.ToString()method on exceptions to present the full exception information (including the inner stack trace) in text:Sample output: