Questions tagged [application-error]

Application_Error handler in the Global.asax file is a method that will fire and catch all unhandled ASP.NET errors while processing a request.

Application_Error handler in the Global.asax file is a method that will fire and catch all unhandled ASP.NET errors while processing a request — in other words, all the errors that are not caught with a Try/Catch block or in a page-level error handler. In the example, the handler transfers control to a generic error page named GenericErrorPage.aspx, which interprets the error and displays an appropriate message.

88 questions
126
votes
9 answers

Application_Error not firing when customerrors = "On"

I have code in the global.asax file's Application_Error event which executes when an error occurs and emails details of the error to myself. void Application_Error(object sender, EventArgs e) { var error = Server.GetLastError(); if…
WDuffy
  • 7,498
  • 5
  • 35
  • 42
75
votes
5 answers

Heroku: How can you check Heroku Error Logs?

I've got a PHP application on a free Heroku account. Today for no apparent reason I got Heroku's Application Error screen for about an hour. No downtimes on Heroku's status report page. I'd like to check the logs to figure out why the application…
Allen S
  • 3,133
  • 4
  • 27
  • 45
18
votes
3 answers

Why is anonymous user trying to access /admin/host/synctriggers?

Since a few days ago, I have started receiving error messages from all my Azure websites: "The controller for path '/admin/host/synctriggers' was not found or does not implement IController." This is coming my an anonymous user (or bot). The full…
Windhoek
  • 965
  • 8
  • 23
18
votes
2 answers

How to get which page threw an exception to Application_error in aspx

I have a general exception handler, Application_error in my global.asax where I'm trying to isolate all the uncaught exceptions on all my many pages. I don't want to use Page_error to catch exception because it's inefficient to call that on so many…
user8456
  • 338
  • 1
  • 4
  • 12
17
votes
6 answers

How to solve exception "File does not exist"?

I have a basic ASP.NET MVC2 site which logs a single "File does not exist" error every time a view (not partial views) is loaded. I am pretty sure this is because I am referencing a file, from the master page, that does not exist, but I cannot…
Øyvind
  • 1,580
  • 1
  • 11
  • 32
16
votes
2 answers

ErrorAttribute vs OnException vs Application_Error

I want to handle application wide error and show a ErrorView page in asp.net mvc. There are 3 ways to do it (or i know). 1) ErrorAttribute in BaseController:Controller class. Can be used on individual Action/Controller/BaseController. 2)…
14
votes
3 answers

Handle "potentially dangerous Request.Form value..."

What's the best way to handle errors such as A potentially dangerous Request.Form value was detected from the client" in ASP.NET? I'd like to keep the validation on, as my forms have no valid reasons to be allowing HTML characters. However, I'm…
keyboardP
  • 66,755
  • 13
  • 145
  • 199
13
votes
4 answers

How to know if the request is ajax in asp.net in Application_Error()

How to know if the request is ajax in asp.net in Application_Error() I want to handle app error in Application_Error().If the request is ajax and some exception is thrown,then write the error in log file and return a json data that contains…
dayulu
  • 169
  • 1
  • 2
  • 7
12
votes
3 answers

System.Web.HttpException File does not exist - Page loads just fine (ASP.NET)

I'm using Log4Net and logging everytime my ASP.NET-Application throws an error: protected void Application_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); Log.Error("An error occurred", ex); …
Dennis Röttger
  • 1,915
  • 6
  • 31
  • 50
5
votes
1 answer

Convert an exception into HTTP 404 response in the Application_Error

First of all, quickly what exactly I want to achieve: translate particular exception into the HTTP 404 so the ASP.NET can handle it further. I am handling exceptions in the ASP.NET (MVC2) this way: protected void Application_Error(object sender,…
4
votes
1 answer

Heroku Django Application Error: Worker Timout Issue (H12)

After fighting for a while, my first python (django) app is deployed successfully, the database is pushed and can be accessed (meaning I can access and play with it using heroku pg:psql), and I can run the app both locally as python manage.py…
jg43
  • 111
  • 8
4
votes
2 answers

How to keep the Server.GetLastError after Response redirecting in MVC

In my Global.asax I have defined the Application_error method : protected void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs // Get the exception object. var exc …
4
votes
5 answers

Application Error thrown in Compact Framework app on Windows Ce 6.0

I get an application error thrown when I close the program using as cancel button which all it does is close the form. The error says: "Application appName.exe encountered a serious error and must shut down" How do I start fixing it? It is not a…
sarsnake
  • 23,178
  • 58
  • 166
  • 281
3
votes
0 answers

Application_Error global.asax not catching all errors (.Net Thread)

We are logging exceptions in application_error at global.asax, but we have witnessed that if there is any exception raised from a background thread this is not being catch there (application_error ) The only way it seems to catch is…
3
votes
3 answers

Session state is not available in this context in Global.asax

I am getting and error message when i'm trying to get Session value in Global.aspx: I have tried another method to get Session value and result is same but message is different: This error occur in Application_Error method and Session is not null…
Amin Jariwala
  • 64
  • 1
  • 1
  • 4
1
2 3 4 5 6