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

  • Home
  • SEARCH
  • 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 8446953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:03:50+00:00 2026-06-10T10:03:50+00:00

When I get the status code 400 I handle the XMLHttpRequest object in this

  • 0

When I get the status code 400 I handle the XMLHttpRequest object in this way (1) and it work.
Anyway I suppose this code is quite specific to my use case.

I would like to be more generic like:
1) How should I handle the server error when I get the status code 500?


(1)

_.each((JSON.parse(xhr.responseText)).children, function (xhrObject, name) {
    element.find('[name="' + name + '"]')
        .parent().append($('<div>')
        .attr('class', 'is-input-invalid')
        .text(xhrObject.errors));
});
  • 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-10T10:03:51+00:00Added an answer on June 10, 2026 at 10:03 am

    It depends on the application. There are three general things you may want to do in response to a 500:

    1. Report that an error happened.
    2. Ignore it.
    3. Try something else.

    The second can be good when the operation isn’t vital to the user (perhaps some background update-check they didn’t even know you were doing), and is absolutely to be avoided otherwise (the only thing worse than having an error reported to you, is not having an error reported to you). The third is quite specialised (the “something else” to try will likely either be obvious, or impossible, depending on what you were trying to do in the first place).

    To obtain anything useful from the 500, you will need the server-side of the code to send you something useful as the body of such messages. Just what “useful” is depends on what you are doing (e.g. plain-text, json, xml are the most likely things for the rest of your code to already be set up to deal with).

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

Sidebar

Related Questions

While in the ResponseFilters is there anyway to get the status code (and description)
Is there a way to get the status how long does it takes to
All Hadoop jobs have unique jobid. You can use jobid to get job status
I have this code: response.headers[X-ERROR-MESSAGE] = A message render :text => Some text, :status
I am in a situation where when I get an HTTP 400 code from
Can we get relationship status changes of our friends from last 3 days including
how to get the status (200 OK, 404 NOT FOUND etc.) of the last
I have a list of Checkboxes & I want to get the status of
I am trying to get the web status for a given page. However when
How do I get the battery status on an iPhone?

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.