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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:16:43+00:00 2026-06-09T14:16:43+00:00

I successfully implemented client editors and a server side API. Now I’m adding more

  • 0

I successfully implemented client editors and a server side API.

Now I’m adding more validation at the server side, and besides returning the proper HTTP code (200 for OK, 4xx for other uses, 500 for errors, etc.) I want to return a list of validations that failed after the submission generated by Model.save().

I run it this way:

myModel.save({
  success: function (a, operation, c) {...},
  failure: function (a, operation, c) {...}
});

But if there was a failure, the operation object only have the response status and its statusText, all through

operation.error.status // i.e. 409
operation.error.statusText // "Conflict"

But server side a detail of the failing validations (mostly domain level ones) are being added to the response.

Is there a way I can get what the server sent as the body of the HTTP response to the PUT/POST submission?

Do I have to return it using a particular JSON structure?

EDIT:
I’m now returning this as the body of the HTTP Response (with code 4xx):

{
 data: {/* the record serialized */},
 success: false, // or true if everything went ok
 message: "This failed because X and Y."
}

Thanks in advance.

  • 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-09T14:16:45+00:00Added an answer on June 9, 2026 at 2:16 pm

    For some reason Ext is not attaching the response content to the error object, but it triggers an exception event if there is a failure.

    So what we did was to handle the "exception" event of the model’s proxy, and then we will have access to the XHR response, being able to do whatever we want with it.

    myModel.getProxy().on('exception', this.onProxyException, this);
    

    The handler is as follows:

    onProxyException : function (proxy, response, operation) {
        var errors;
        errors = Ext.JSON.decode(response.responseText).message;
        /* Whatever is needed with the errors */
    }
    

    In this example we asume the errors come in JSON format, they could be a simple text string, which wouldn’t require the use of decode().

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

Sidebar

Related Questions

I have successfully implemented a restful service that works with my own client. Now,
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat
I have successfully implemented Forms Authentication in SSRS, so it now uses both Roles
I am learning java ee right now. I have successfully implemented a hello-world style
We have successfully implemented Apache Solr to return the x most relevant dialogs as
I have successfully implemented a cel shader using glsl. But my problem is about
I have successfully implemented a network application in visual CLR project using boost.asio. but
I have successfully implemented interop beftween Win32 application and managed .Net dll as described
I have successfully implemented printing and print preview for my app using the PrintDocument,
I have successfully implemented SUBSONIC DAL in my desktop application. it was superb experience.

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.