NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
863 stars 171 forks source link

Is the documentation or sample code out of date for nuget v1.0.130? Or vice-versa? #115

Closed lamontadams closed 6 years ago

lamontadams commented 6 years ago

Hi,

Trying to do a "code-only" configuration as described here https://nickcraver.com/StackExchange.Exceptional/AspDotNet using nuget package https://www.nuget.org/packages/StackExchange.Exceptional/1.0.130.

Few things, probably just confusion on my part...

  1. I can't locate a SQL script to create the appropriate SQL Server Exceptions table anywhere in the nuget package - I probably just don't have the right one. I grabbed and used https://github.com/NickCraver/StackExchange.Exceptional/blob/master/DBScripts/SqlServer.sql should that work with the version I have from nuget?

  2. I can't locate a suitable "Log" extension method for System.Exception as referred to in the quickstart documentation and in the MVC sample app in either of StackExchange.Exceptional or StackExchange.Exceptional.Stores namespaces. Taking a look at the master source, I don't see one in https://github.com/NickCraver/StackExchange.Exceptional/blob/master/src/StackExchange.Exceptional.Shared/Extensions.cs. Should there be one somewhere or is it assumed I've created one?

  3. Falling back to ErrorStore.LogException inside Application_Error seems to fail silently after having done ErrorStore.Setup in Application_Start. After setting a breakpoint and throwing an exception elsewhere, I can see the Application_Error method fire, and see the call to ErrorStore.LogException being made, but there are no rows written to the Exceptions table. I checked what I have against the sample code at https://github.com/NickCraver/StackExchange.Exceptional/blob/master/samples/Samples.MVC5/Global.asax.cs and if there's a difference it's subtle and I'm not seeing it.

I can never get markdown to cooperate, so I've attached a sample from my app. What am I missing here?

SampleGlobal.asax.cs.txt

lamontadams commented 6 years ago

Partially solved -

Looking at ErrorStore.LastRetryError, I see an exception with the message "Invalid column name 'SQL'"

So where's the correct definition for the Exceptions table??

lamontadams commented 6 years ago

Right so I found the version tag for nuget's current version.

What I needed was https://github.com/NickCraver/StackExchange.Exceptional/blob/v1.0.130/DbScripts/SqlServerExceptions.sql