Elmah not storing stack trace when Facebook C# SDK throws Exception
I'm using Elmah and the Facebook C# SDK (http://facebooksdk.codeplex.com/)
Elmah has been working really well for me. However, when the Facebook C# S开发者_运维技巧DK throws an exception, the stack trace is not logged.
For example, when I throw this exception:
throw new FacebookApiException("this is a test");
The stack trace shows up properly in my browser (with debug turned on, of course), but Elmah doesn't store it. Instead, this is all I see inside Elmah's "AllXml" column in the database:
detail="(Unknown) this is a test"
Usually, the detail attribute of the AllXml column will contain the full stack trace. Do you know why this is? How can I get Elmah to log the stack trace?
Thanks in advance.
I believe this was caused by the override we had on FacebookApiException.ToString(). I removed the override. If you want, download the current source and give that a try. Let me know if it solved the issue.
If you are using the HandleError Attribute, you'll find this question really useful.
ELMAH and HandleError
精彩评论