Fix exception to string in case of exception in callstack extraction
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 22 Mar 2016 11:05:07 +0000 (12:05 +0100)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 22 Mar 2016 16:40:13 +0000 (17:40 +0100)
commit1b821412796486ee362b1672a19b705275441b15
tree74c070ca055bf5c3dfe4922538564c41208fd68a
parent54e298abc6d73dc80a9243ef091ac324e7665ff9
Fix exception to string in case of exception in callstack extraction

This change fixes a problem when exception happens while converting an exception
call stack to string. Without this change, Exception.ToString would fail and
if the exception was unhandled, it would just print "Cannot print exception string
because Exception.ToString() failed." without any details on what exception happened.
The problem happens e.g. in case when a method on the call stack has a parameter
that contains members of types from an assembly that cannot be resolved.

The fix was to catch exception from parameter info extraction and if it happens,
just exclude the parameter list from the reported frame.
src/mscorlib/src/System/Diagnostics/Stacktrace.cs