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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:50:57+00:00 2026-05-25T02:50:57+00:00

I notice OpenRasta.Core has an HtmlErrorCodec which is responsible for rendering a the server

  • 0

I notice OpenRasta.Core has an HtmlErrorCodec which is responsible for rendering a the server error page sent out when a handler throws an Exception.

When I make an JSON Ajax request to an exception throwing handler this Codec is selected and the exception is rendered as HTML.

I have tried to register my own IMediaTypeWriter for IList<Error> with MediaType(“application/json”) so I can send back JSON to the browser, but it seems to be ignored. Can anyone help?

Thanks
Neil

  • 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-25T02:50:57+00:00Added an answer on May 25, 2026 at 2:50 am

    If there is an error, indeed a codec with IList will be selected, but will follow the normal conneg for a type.

    I’d suggest having a look at the request log and finding out how and why the html codec gets selected (I’d suspect with my remote debugging tunnel vision that you may have a browser sending the equivalent of Accept: text/html,application/json, at which point OR doesn’t really know which of the two is acceptable, which is probably a bug as we register text/html with a q of 1 where it should be 0.5). If that’s indeed what the problem is, the solution is to remove the registration for the html error codec, which you can do by providing your own DependencyRegistrar.

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

Sidebar

Related Questions

Notice in the bottom right hand corner of this page it has the SVN
Notice the following code. The offending line has been commented out. interface I<R> {
Notice how for every image that google indexes it has a small thumbnail .
Notice: You have an error in your SQL syntax; check the manual that corresponds
I notice that StackOverflow has a views count for each question and that these
Notice: Constant DIR_FS_CATALOG already defined I've already commented out display_errors in php.ini , but
Notice the following result when I submit blank :title and :description fields Error div
Notice, this is a remote server, I don't have access to it, only to
Notice that the Derived class constructor has ii as its first argument, but the
I notice in several API's, that you may create a struct which is used

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.