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 8875827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:04:52+00:00 2026-06-14T19:04:52+00:00

From http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling HttpResponseException What happens if a Web API controller throws an exception? By

  • 0

From http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling

HttpResponseException

What happens if a Web API controller throws an exception? By default,
most exceptions are translated into an HTTP response with status code
500, Internal Server Error.

The HttpResponseException type is a special case. This exception
returns any HTTP status code that you specify in the constructor of
the exception.

Except that it doesn’t. Fiddler shows me a 500 is returned.

However, HttpException seems to do what that article says.

Is the documentation wrong or am I missing something?

UPDATE

While typing that out, I had an idea. I tried both from two controllers, an ApiController and a standard MVC controller.

The two exception work in reverse to each other depending on the type of controller they’re thrown from.

  • Use HttpResponseException to return a proper HTTP code from an API
    controller.
  • Use HttpException to return a proper HTTP code from an
    MVC controller.
  • 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-06-14T19:04:53+00:00Added an answer on June 14, 2026 at 7:04 pm

    [Moved my update to an answer]

    While typing that out, I had an idea. I tried both from two controllers, an ApiController and a standard MVC controller.

    The two exception work in reverse to each other depending on the type of controller they’re thrown from.

    • Use HttpResponseException to return a proper HTTP code from an API controller.
    • Use HttpException to return a proper HTTP code from an MVC controller.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ref. this Microsoft's official video: http://www.asp.net/web-api/videos/getting-started/custom-validation I downloaded the code and run it. It's
Just trying to download it from http://www.asp.net/downloads for the first time. Web Platform Installer
I recently downloaded an event calendar from this link: http://www.asp.net/downloads/starter-kits/club/EventCalendar.zip I want to use
I can't read dates from ajax calendar control after date selection http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx I don't
I tried to install MVC Framework from the below URL http://www.asp.net/mVC/ First it is
I am developing a web app base on this guide: http://www.asp.net/data-access/tutorials/declarative-parameters-cs I am able
I followed the following tutorial to help me create a datagrid ( http://www.asp.net/web-pages/videos/aspnet-razor-pages/displaying-data-in-a-grid ),
I've been reading some async articles here: http://www.asp.net/web-forms/tutorials/aspnet-45/using-asynchronous-methods-in-aspnet-45 and the author says : When
I found a way to write avi from BMP files: http://www.delphi3000.com/articles/article_2770.asp?SK= I want to
I am using this guide: http://www.asp.net/mvc/tutorials/mvc-music-store-part-7 Like instructed, I entered to ASP.NET Web Application

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.