Cheya,
There is no assembly to do this for you, but if you take the time to
iterate through the exception object's error parameters and log/display the
values, you can often get more information than even a stack trace
would give you. Below is an example from the .Net CF Core Reference
provided for a SqlCE exception. I have created similar methods for Web
exceptions, I/O exceptions, etc. If you ever run a debug session and start
drilling down through the nexted levels of exception parameters, there is
a host of valuable information in this heirarchy that you can use to
troubleshoot
your application.
private void _displaySQLCEErrors(SqlCeException ex)
{
SqlCeErrorCollection errorCollection = ex.Errors;
StringBuilder bld = new StringBuilder();
Exception inner = ex.InnerException;
foreach (SqlCeError err in errorCollection)
{
bld.Append("\n Error Code: " + err.HResult.ToString("X"));
bld.Append("\n Message : " + err.Message);
bld.Append("\n Minor Err.: " + err.NativeError);
bld.Append("\n Source : " + err.Source);
foreach (int numPar in err.NumericErrorParameters)
{
if ( 0 != numPar ) bld.Append( "\n Num. Par. : " + numPar );
}
foreach ( string errPar in err.ErrorParameters )
{
if ( String.Empty != errPar ) bld.Append( "\n Err. Par. : " + errPar );
}
MessageBox.Show( bld.ToString(), "SQL Server CE Error" );
bld.Remove(0, bld.Length);
}
}
-Darren