error event not called on timeout

8 posts, 1 answers
  1. steve
    steve avatar
    7 posts
    Member since:
    Oct 2014

    Posted 09 Nov 2014 Link to this post

    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
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 12 Nov 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. steve
    steve avatar
    7 posts
    Member since:
    Oct 2014

    Posted 12 Nov 2014 in reply to Alexander Popov Link to this post

    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?
  5. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 14 Nov 2014 Link to this post

    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!
     
  6. steve
    steve avatar
    7 posts
    Member since:
    Oct 2014

    Posted 16 Nov 2014 Link to this post

    Thanks for your help.
    Regards,
    Steve
  7. Don
    Don avatar
    2 posts
    Member since:
    Aug 2015

    Posted 27 Oct 2015 Link to this post

    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>

  8. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 28 Oct 2015 Link to this post

    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!
     
  9. Don
    Don avatar
    2 posts
    Member since:
    Aug 2015

    Posted 28 Oct 2015 in reply to Alexander Popov Link to this post

    Got it.  Thanks Alex.
Back to Top
Kendo UI is VS 2017 Ready