NickCraver / StackExchange.Exceptional

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

Added WebApi-filter and sample-project to catch WebApi-exceptions #75

Closed itssimple closed 7 years ago

itssimple commented 7 years ago

Additional setup to handle WebApi-exceptions: In ~/App_Start/WebApiConfig.cs, add: config.Filters.Add(new StackExchange.Exceptional.WebApi.WebAPIExceptionHandlerAttribute());

The WebApi-extension requires at least .NET 4.5

74 can be closed, since SOAP is deprecated

NickCraver commented 7 years ago

This adds a lot more porting to .NET Core weight in the coming weeks - I'd much rather wait until after that's done before such an addition. Also: while it may seem minor, you ignored the /packages folder which is a huge dependency change, and creates a large dependency list for builds.

itssimple commented 7 years ago

Ah, of course. I missed the v2-branch.

Yeah, I wasn't sure if I was supposed to include the packages folder. Habit from work. I'll fix the .gitignore again. Sorry.

itssimple commented 7 years ago

I cannot open the solution in VS15 after a reload. It gets stuck while initializing Samples.Console and never finishes. No error messages or anything, it just freezes.

Closing the request until I sort this out.

itssimple commented 7 years ago

If I remove all packages before I open the solution, it works. But after successful build and reload, it gets stuck on initializing.

No clue what the problem is in this case.

chyredwan commented 4 years ago

Hi, understand this is deprecated. But is there any other extension for WebApi logging? Apprentice your advice.

itssimple commented 4 years ago

If you are using .NET Core, you can use a middleware to handle exceptions in an WebApi.