Results 1 to 7 of 7

Thread: Ext.promise catch building error

    Success! Looks like we've fixed this one. According to our records the fix was applied for SDKTOOLS-876 in 6.5.0.
  1. #1
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default Ext.promise catch building error

    Hi guys,

    I setup a promise to load some settings from a json file.


    PHP Code:
    loadSettings: function()
    {
        var 
    me this;

    // Load the application settings from the data file
    myapp.model.Settings.loadSettings()
            .
    then( function(records) {
                
    console.log"Settings loaded" );
    })
            .catch( function(
    error) {
                
    console.log(error)
            });
    }, 
    When I try to build a production version of the app, the YUI compression fails asking for a name being used before the .catch code.

    I can't find an example of the promise being rejected in the documentation.
    Can someone help me on this?

    Thanks

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Thanks for the report, I've added this bug to our tracking system.


    Regards,
    Bryan

  3. #3
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default

    Any news about this bug?

    Thanks

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Finland
    Posts
    19

    Default

    Bump, I'm having this same issue.

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2015
    Posts
    1

    Default

    I'm also hoping this will be fixed soon for now I'm calling catch like this:
    Code:
    loadSettings: function(){
      // Load the application settings from the data file
      myapp.model.Settings.loadSettings().then(function(records){
        console.log( "Settings loaded" );
      })['catch'](function(error){
        console.log(error)
      });
    }

  6. #6
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    66

    Default

    I'm also having this issue. Great idea for a workaround, rcrb--thanks!

  7. #7
    Sencha Premium User
    Join Date
    Oct 2011
    Location
    Paris
    Posts
    21

    Default

    This article https://www.sencha.com/blog/asynchro...ript-promises/ has been useful to me.

    The then methods takes 2 parameters one to resolve the results, the other when the operation is rejected. catch is therefore not necessary.

    The build then works as expected.

    Philippe

Similar Threads

  1. [FIXED] Bug: Sencha Cmd 5 can't build apps that use ES6 Promise.catch()
    By robpalme in forum Sencha Cmd
    Replies: 8
    Last Post: 3 Dec 2015, 3:47 AM
  2. Replies: 2
    Last Post: 26 May 2014, 6:25 PM
  3. Replies: 14
    Last Post: 1 Oct 2013, 11:49 AM
  4. Catch SQL Error
    By marcKun in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 29 Dec 2008, 7:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •