We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Handling Errors

Thread ID:

Created:

Updated:

Platform:

Replies:

121518 Dec 22,2015 07:20 PM UTC Dec 24,2015 11:55 AM UTC JavaScript 3
loading
Tags: ejDataManager
Hostilio
Asked On December 22, 2015 07:20 PM UTC

Hello, i need help with the following:

1. How to Handle error when the ASMX webservice doesn't exists anymore cause for example it was moved, name changed
2. How to handle a timeout error.
3. How to handle any error example, webservice could have a error for example division by 0 and not handle it a try catch

At my different test escenarios none of those escenarios runs .done code.

I'm trying to use ej.DataManager with knockoutjs, require, bootstrap :) and with the following code i can call the ASMX webservice and read the data fine as long as there are no communication error.

 var dataManager = ej.DataManager({
                url: "/Datos.asmx/CatalogoIncidente",
                adaptor:new ej.UrlAdaptor(), //"UrlAdaptor",
                crossDomain: false,
                offline: false
            });
            var query = ej.Query();
            query.addParams("userName", "EB_HMACIAS");
            var promise = dataManager.executeQuery(query);
            promise.done(function (e) {
                ko.mapping.fromJSON(e.result, {}, self);
            });

Thanks for response

Prasanna Kumar Viswanathan [Syncfusion]
Replied On December 23, 2015 09:31 AM UTC

Hi Hostilio,

Thanks for contacting Syncfusion support.

We can handle the error or any exception in the fail function. The fail function gets invoked when there is any error while making the request or an exception.

For your convenience, we have created a sample and thrown an exception manually in the
 ASMXPage.

Please find the following code example and sample:


<script type="text/javascript">

       

        var dataManager = ej.DataManager({

            url: "/WebService.asmx/Get",

            adaptor: new ej.UrlAdaptor(), //"UrlAdaptor",

            crossDomain: false,

            offline: false

        });

        var data = [];

        var query = ej.Query();

        query.addParams("userName", "EB_HMACIAS");

        var promise = dataManager.executeQuery(query);

        promise.done(function (e) {

            data = e.result.result;

        });

        promise.fail(function (e) {

            alert("Handling errors")

        });     
    </script>  


Sample: http://www.syncfusion.com/downloads/support/forum/121518/ze/KnockoutSample_(2)-918495002

Regards,
Prasanna Kumar N.S.V


Hostilio
Replied On December 23, 2015 02:22 PM UTC

Thank you very much, really thanks.

I'm not a native english speaker but, can you point me to the documentation or example about fail? cause i'm still dunno on how could i miss it!



Prasanna Kumar Viswanathan [Syncfusion]
Replied On December 24, 2015 11:55 AM UTC

Hi Hostilio,

We have created an improvement task for the UG documentation and a support incident has been created under your account to resolve the issue. Please log on to our support website to check for further updates. 


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,
Prasanna Kumar N.S.V


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;