Error Handling within an Editor and ImageBrowser

2 posts, 0 answers
  1. Rodrigo
    Rodrigo avatar
    1 posts
    Member since:
    Nov 2014

    Posted 31 Aug 2015 Link to this post

    Hello! I'm using the Editor with a button to display the ImageBrowser component.

    My API will return a Bad Request status code whenever the image is too large or somehow invalid to be uploaded.

    I wasn't able to customize the error message displayed. Also, even though the request returns with an error, the item is displayed within the Image Browser with the loading icon.

    I checked and even on the demos this is happening.

    How can I have the image browser to not display items when the request (to upload) return with an error and also customize how the error message is displayed? (ie, display the string content returned by the server without prepending content to the string as the default behavior).

    Thanks for helping.
  2. Alexander Popov
    Alexander Popov avatar
    1436 posts

    Posted 03 Sep 2015 Link to this post

    Hi Rodrigo,

    You can try getting the ImageBrowser instance once the command is executed. This will allow you to access the Upload widget as well and subscribe to its error event. For example:  
      execute: function(e){
        if( == "insertimage") {
          setTimeout(function() {
            var ib = $("[data-role='imagebrowser']").getKendoImageBrowser();
            ib.upload.bind("error", function() {
              alert("error uploading file");

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top