This is a migrated thread and some comments may be shown as answers.

error event not called on timeout

7 Answers 416 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
steve
Top achievements
Rank 1
steve asked on 10 Nov 2014, 04:51 AM
I'm trialling Kendo UI v2014.2.1008, with Cordova (using the Visual Studio 2013 extension) on Win 8.1

I'm getting some data via jsonp, which is just served locally at the moment. All works fine except if I turn off the server - "Failed to load resource: net::ERR_CONNECTION_REFUSED" appears in the console after 3 seconds, but I cannot catch the timeout using the datasource error event. 

var _dsRawDataBundle = new kendo.data.DataSource({
    offlineStorage: 'kui_raw',
    transport: {
        read: { 
            url: 'http://localhost:5000/datasets/1/rawData',
            dataType: 'jsonp'
        }
    },
    change: function (e) {
        var data = this.data();
        console.log('Got livestock raw data bundle: ' + JSON.stringify(data));
    },
     
    error: function (e) {      // Not being called on timeout
        console.log('Reading raw data failed: ' + e.status);  
    }
});

Regards,
Steve

7 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 12 Nov 2014, 08:24 AM
Hi Steve,

There is no error handling for JSONP requests, however you can try explicitly specifying the timeout option. For example: 
read: {
    url: 'http://localhost:5000/datasets/1/rawData',
    timeout: 2000,
    dataType: 'jsonp'
}

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
steve
Top achievements
Rank 1
answered on 12 Nov 2014, 10:31 PM
Hi Alexander

thanks, the error function is called when the timeout is explicitly set.

You said "There is no error handling for JSONP requests". Does this mean I cannot expect the code shown in http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.errors to work when using jsonp?
0
Accepted
Alexander Popov
Telerik team
answered on 14 Nov 2014, 03:34 PM
Hello again Steve,

That is correct. Setting a timeout will trigger the error event, however the error will always be "timeout". This behavior is not related to Kendo UI and I am afraid there is no good solution or a workaround that we can suggest.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
steve
Top achievements
Rank 1
answered on 16 Nov 2014, 09:55 PM
Thanks for your help.
Regards,
Steve
0
Don
Top achievements
Rank 1
answered on 27 Oct 2015, 12:31 PM

I have a problem with Kendo UI when I click this link the demo keeps loading and never stop.  So, I hit F12 and see errors below at console tab.  Do anyone have any idea? 

Failed to load resource: net::ERR_CONNECTION_REFUSED
kendo-ui:209 Uncaught TypeError: Cannot set property 'browser' of undefined
kendo-ui:713 Uncaught TypeError: $ is not a function
(program):1 Uncaught TypeError: b is not a function
kendo-ui:920 Uncaught TypeError: $ is not a function
kendo.custom.min.js:1 Uncaught TypeError: Cannot read property 'extend' of undefined
live-edit.min.js:6 Uncaught TypeError: Cannot read property 'Widget' of undefined
kendo-ui:1293 Uncaught TypeError: $ is not a function
kendo-ui:1375 Uncaught TypeError: $ is not a function
kendo-ui:1436 Uncaught TypeError: $ is not a function
kendo-ui:1536 Uncaught TypeError: $ is not a function
kendo-ui:1683 Uncaught TypeError: $ is not a function
Telerik.Web.UI.WebResource.axd:1370 Uncaught TypeError: Cannot read property 'migrateMute' of undefined
jQuery.Validate.min.js:13 Uncaught TypeError: Cannot read property 'extend' of undefined
all.min.js:1 Uncaught TypeError: $ is not a function
kendo-ui:1782 Uncaught ReferenceError: Web is not defined
www.googletagmanager.com/gtm.js?id=GTM-6X92:51 Uncaught #<Object>

0
Alexander Popov
Telerik team
answered on 28 Oct 2015, 08:55 AM
Hello Don,

This seems to be caused by a network issues. Please, check if the issue persists and if there are any scripts that failed to load as well.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Don
Top achievements
Rank 1
answered on 28 Oct 2015, 11:26 AM
Got it.  Thanks Alex.
Tags
Data Source
Asked by
steve
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
steve
Top achievements
Rank 1
Don
Top achievements
Rank 1
Share this question
or