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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:35:55+00:00 2026-06-11T13:35:55+00:00

My webservice puts details about the occoured error in the http body. How can

  • 0

My webservice puts details about the occoured error in the http body.
How can I access this details in a dojo request.

For example the http error looks like this:

HTTP/1.1 500 Internal Server Error
Transfer-encoding: chunked
Content-type: application/json
Date: Tue, 18 Sep 2012 18:47:31 GMT

15
This is my exception!
0

My Dojo Request looks like this:

require(["dojo/dom", "dojo/on", "dojo/request",
        "dojo/json", "dojo/domReady!"],
    function(dom, on, request, JSON){
        // Results will be displayed in resultDiv
        var resultDiv = dom.byId("errorResult");

        // Attach the onclick event handler to the makeRequest button
        on(dom.byId('errorButton'),"click", function(evt){
            request.get("./rest/test/error", {
                // Parse data from JSON to a JavaScript object
                handleAs: "json"
            }).then(function(data){
                resultDiv.innerHTML = "Username: " + data.name + "</br>Role:" + data.role;
            },
            function(error){
                // Display the error returned
                resultDiv.innerHTML = error;
            });
        });
    }
);

The displayed error in the is:

RequestError: Unable to load ./rest/test/error status: 500

And what i would like to have there is the text in the body:

This is my exception!
  • 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-11T13:35:57+00:00Added an answer on June 11, 2026 at 1:35 pm

    Have a look at my answer to How to retreive XHR response code (+timestamp) of AMD’ized Dojo?

    Use deferred.response.then instead of deferred.then:

    var deferred = request.get("./rest/test/error", { handleAs: "json" });
    
    deferred.response.then(
        // success
        function(response) {
            console.log("data:", response.data);      // parsed json
            console.log("http body:", response.text); // raw text
        },
        // error
        function(error) {
            var response = error.response;
            console.log("http body:", response.text);
        }
    );
    

    See it in action at jsFiddle: http://jsfiddle.net/phusick/SGh5M/

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

Sidebar

Related Questions

This webservice is almost converted form VB to C#, except I get this error
Am calling a webservice from my jQuery to fetch both Staff and Student details.
http://localhost:2000/WebService/Handler.ashx?d=ck Response when viewing URL: {Status:OK,Message:0,Info:(none)} Using JQuery how do I pull from that?
I having a hard time to consume this webservice https://www.arello.com/webservice/verify.cfc?wsdl in my rails application.
Is there a way I can access traffic data that Google provides through a
XML Webservice: the webservices takes in an XML request and responses with a XML
My webservice constructor is getting called each time that I call a webmethod. This
I have a jboss webservice like this: @Stateless @SecurityDomain(SecurityDomain) @RolesAllowed(RolesAllowed) @WebContext(urlPattern = /*, authMethod
@WebService(targetNamespace = http://ekokontrol.lenobl.smev.ru, name=Ekokontrol) @SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL) public interface EkokontrolIF { @WebMethod(operationName=inspection, action=urn:inspection) @WebResult(name=return) public
My webservice generates jsonp response same as http://demos.kendoui.com/service/products . When i try to create

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.