Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6099203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:14:46+00:00 2026-05-23T13:14:46+00:00

I want to handle uncaught exceptions in my ASP.NET MVC 3 application, so that

  • 0

I want to handle uncaught exceptions in my ASP.NET MVC 3 application, so that I may communicate the error to the user via the application’s error view. How do I intercept uncaught exceptions? I’d like to be able to do this globally, not for each controller (although I wouldn’t mind knowing how to do this as well).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:14:46+00:00Added an answer on May 23, 2026 at 1:14 pm

    You can set up a global error filter in Global.asax

    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
    }
    

    The above sets up a default error handler which directs all exceptions to the standard error View. The error view is typed to a System.Web.Mvc.HandleErrorInfo model object which exposes the exception details.

    You also need to turn on custom errors in the web.config to see this on your local machine.

    <customErrors mode="On"/>
    

    You can also define multiple filters for specific error types:

    filters.Add(new HandleErrorAttribute
    {
        ExceptionType = typeof(SqlException),
        View = "DatabaseError",
        Order = 1
    });
    
    /* ...other error type handlers here */
    
    filters.Add(new HandleErrorAttribute()); // default handler
    

    Note that HandleErrorAttribute will only handle errors that happen inside of the MVC pipeline (i.e. 500 errors).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to handle exceptions that happen inside of DoWork handler in my RunWorkerCompleted
I'm implementing the Enterprise Library Exception Handling Application Block in an ASP.NET application that
I want to handle the keydown event globally in my application and as such
i want to handle the tab keypress in such a way that if there
Unchecked exceptions are alright if you want to handle every failure the same way,
In summary : I have an ASP.NET web page that causes an AJAX postback
I want to define one application level UncaughtExceptionHandler in my Java application that is
Here's my error: *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
I want to handle events on a treeview with ACB ( http://marlongrech.wordpress.com/2008/12/04/attachedcommandbehavior-aka-acb/ ). I
I am trying decide on how I want to handle the UI for an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.