NickCraver / StackExchange.Exceptional

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

Always "Yay, no errors" #7

Closed plurby closed 12 years ago

plurby commented 12 years ago

Hi,

i've did the exact same setup as the MVC sample and the errors are not being logged. Currently the project in which i will use your great library is MVC3. It's a large project and i was using ELMAH before.

The action Exceptions is always returning "Yay, no errors." even when i make a 404 and refresh it.

Is there a reason the errors are not logged and how can i test why there is no logging happening.

NOTE: In VS2012 and your MVC4 sample everything works and errors are logged. Thanks in advanced

NickCraver commented 12 years ago

A 404 is not an unhandled exception in IIS...since there would be lots of them in every site it's just not a case that throws an exception. If you have the route registered try /test after it (to trigger the internal test method) or just throw new Exception("test"); in your code. Are you seeing any errors logged after this?

plurby commented 12 years ago

I tried that, in the

public ActionResult Throw() { throw new Exception("Testing"); } And when i go to the Exceptions i still see "Yay, no errors." and there is no error in the SQLStore either.

I really don't have an idea why it's not working because there are no errors or warnings.

Any other way i can see what's the problem? Sorry for bothering you.

NickCraver commented 12 years ago

Do you have the error handler's module specified in the web.config? Make sure the handler here is present:

<system.webServer>
  <modules>
    <add name="ErrorStore" type="StackExchange.Exceptional.ExceptionalModule, StackExchange.Exceptional" />
  </modules>
</system.webServer>
plurby commented 12 years ago

It's there, everything is the same as in the MVC sample.

EDIT:

I've found out that in the:

void IHttpHandler.ProcessRequest(HttpContext context) { ProcessRequest(); } context.CurrentNotification' threw an exception of type 'System.PlatformNotSupportedException' and 'context.IsPostNotification' threw an exception of type 'System.PlatformNotSupportedException'

Managed pipline mode is Integrated.

Any ideas?

plurby commented 12 years ago

I've solved it:

If in the project properties under Web tab you have selected Use Visual Studio Development Server the errors will not be logged and you'll get a "silent" exception thrown on the

context.CurrentNotification' threw an exception of type 'System.PlatformNotSupportedException'

and

'context.IsPostNotification' threw an exception of type 'System.PlatformNotSupportedException'

To solve this select Use Local IIS Web Server and check Use IIS Express.

Everything works fine now.