Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Command should return exit code >0 if it hits an error condition:

  1. #1
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    86
      0  

    Default Command should return exit code >0 if it hits an error condition:

    Please exit > 0 if the toolset hits an exception along the way. Many of us are writing tools to use this to minify our st2 projects, and we should only have to check to see if [ $? -gt 0 ], but instead, we will now have to check the output for the string "[ERROR]".

    Code:
    JMBP-2:silk jgarcia$ sencha app create blah /var/spool/blah && echo $?
    [ERROR] ENOENT, no such file or directory '/www/npr/silk/version.txt'
    
    Usage:
        sencha app create [arguments...]
    
    Description:
        (Alias to 'sencha generate app') Generate a new project with the recommended structure
    
    Arguments: (*) denotes required parameter
    
          -n, --name     * The namespace of the application to create. This will be used as the prefix for all your classes
          -p, --path     * The directory path to generate this application to.
          -l, --library   The library's build to develop your application with, either 'core' or 'all'. Defaults to 'core'
        
    Examples:
        Long:
          sencha app create --name=MyApp --path=/path/to/myapp --library=all 
    
        Short:
          sencha app create -n MyApp -p /path/to/myapp -l all 
    
        Shortest (arguments must be in the right order):
          sencha app create MyApp /path/to/myapp all 
    
    0

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    Howdy there partner! Have entered this in. SDKTOOLS-45
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
      0  

    Default

    bump

    Code:
    PATH=$PATH:/Applications/SenchaSDKTools-2.0.0-Beta:/Applications/SenchaSDKTools-2.0.0-Beta/jsbuilder/:/Applications/SenchaSDKTools-2.0.0-Beta/bin sencha build -p app.jsb3 -d . && echo "success"
    Project file doesn't exist
    success

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    21
    Vote Rating
    1
      0  

    Default

    Here's a fix, though a bit complicated.

    in sencha.js (the one executed by node, /Applications/SenchaSDKTools-2.0.0-beta3/sencha.js on OSX) add this listener after the child process is spawned. (line 78 in 2.0.0-beta3)
    Code:
    cmd.on('exit', function(errorCode){
        process.exit(errorCode);
    });
    Then within your project you need to alter both Application.js and Cli.js

    Application.js (approximately line 427, src/module/Application.js from your project root)
    Code:
    var error = {};
    error.message = "Failed loading your application from: '"+appUrl+"'. " + (!config.url ? "Try setting the " +
                    "absolute URL to your application for the 'url' item inside 'app.json'" : "");
    throw error;
    And Cli.js (approximately line 80, sdk/command/src/Cli.js from your project root)
    Code:
            process.on('uncaughtException', function(e) {
                if(e.message)
                    this.error(e.message);
                process.exit(1);
            }.bind(this));
    Email me if there is a good place to check out source and i'll submit a proper patch.

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,724
    Vote Rating
    248
      -1  

    Default

    This bug has been fixed in V3 of Sencha Cmd.
    Don Griffin
    Director of Engineering - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    2
    Vote Rating
    1
      1  

    Default Still Occurs in Sencha Cmd v3.1.1.274

    For example,

    I am trying to concatenate and minify my code, but the bundled closure compiler spits out some errors,

    [INF] Concatenating output to file C:\Program Files (x86)\Jenkins\jobs\[...].js[INF] Compressing data with ClosureCompressor[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:190160

    [ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:190660[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:191460[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:192260[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:193060[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:326563[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:519267[ERR] C2001: Closure Compiler Error (Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.) -- compression-input:814863
    [INF] Concatenating output to file C:\Program Files (x86)\Jenkins\jobs\[...].js

    The return code, as indicated by %ERRORLEVEL% is still 0.

  7. #7
    Sencha User
    Join Date
    Dec 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Me and my team are still facing this issue as of version 3.1.2.342

  8. #8
    Sencha Premium Member Fredric Berling's Avatar
    Join Date
    Sep 2007
    Location
    Sweden
    Posts
    198
    Vote Rating
    17
      0  

    Default Also facing this problem

    I am using TeamCity 8.01 s command line runner to run sencha cmd and i can confirm it will return 0 even if there is an error. This makes TeamCity report success even if build fails.

    Sencha Cmd Version 3.1.2.342
    Last edited by Fredric Berling; 1 Jul 2013 at 12:11 AM. Reason: included cmd version

  9. #9
    Sencha User
    Join Date
    Dec 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    A straightforward workaround for TeamCity is to resort to Build Failure Conditions to make it fails if it encounters the exact text "[ERR]".

  10. #10
    Sencha User
    Join Date
    Jun 2010
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Yup, we've run into this too. I purposely made a build that would fail to test this out:

    PHP Code:
       create resources/my-theme-all-rtl-debug.css
    [ERR]
    [
    ERRBUILD FAILED
    [ERRcom.sencha.exceptions.ExProcesscompass process exited with non-zero code
     
    1
    [ERR]
    [
    ERRTotal time12 seconds
    [ERR]
    [
    ERRBUILD FAILED
    [ERRcom.sencha.exceptions.BasicExceptioncom.sencha.exceptions.ExProcesscom
    pass process exited with non
    -zero code 1
    [ERR]
    [
    ERRTotal time13 seconds
    [ERRcom.sencha.exceptions.BasicExceptioncom.sencha.exceptions.ExProcesscom
    pass process exited with non
    -zero code 1

    C
    :\Sencha\my-workspace\packages\my-theme>echo %ERRORLEVEL%


Page 1 of 2 12 LastLast

Posting Permissions

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