This exception never happened
I’m not sure what is going on, but it is strange.
This seems to be related to having multiple catch statements with the same exception name, but I can’t reproduce this in isolation.
And it seems that other people have run into it as well: http://stackoverflow.com/questions/5650868/net-exception-caught-is-unexpectedly-null
Worked around it by changing the parameter name… but still, really strange.
Comments
Is this happening on mono or the MS CLR? (Not that I'll have a clue either way).
Chris, MS CLR
This is very strange, seems like MS bug
You can try debug it in CoreCLR :)
Out of curiosity, are you using Code Contracts, or is this a different root cause?
It probably is a non-CLS compliant exception and becomes null when cast to Exception.
Patrick, Nope, no code contracts
Franz, No, that exception is actually InvalidOperationException
Is it also logged in your code as null? If not, it might be a debugger bug.
Did you notice the:
Is that invalid syntax, or am I not seeing the wood for the trees?
Dominic, !== is valid js. See: http://www.w3schools.com/js/js_comparisons.asp
And the script has errors, sure, that is why we are trying to look more deeply into that
Perhaps the issue isn't that the Exception is null; this behaviour is reproducible (in Debugger only) by attaching a [DebuggerDisplay] attribute to an Exception which resolves to a 'null' value;
Curiously, just got the same issue in MonoDevelop on Ubuntu (using Mono 3.10 and MonoDevelop 5.8) Very strange...
Comment preview