Stacktrace for Cloud Code errors?



  • Is there a way to get a full stacktrace for errors?

    Especially when using bridge.include, it is possible to have deeply nested logic which makes it very difficult to track down the code path that caused the errors.

    I have some code that works locally (node.js env), but not in Rhino, it seems:

    const Assert = {}; 
    
    function stackTrace() {
        var err = new Error();
        return err.stack;
    }
    Assert.assert = function(expr, message){
        if ( !expr ){
            console.log(stackTrace());
            throw message;
        }
    };
    

    Thanks,
    Travis



  • I'm interested in this too! I tried a few things that didn't seem to work. Since there's no "step through" like GameSparks, for example, gotta rely on stacktraces for fast debugging.

    I find myself devving a bit slow when I have errs due to no stacktraces. Or ... is there a way?


  • brainCloud

    It looks like the next Rhino release may have some extra support for us there. We will look to enable it once it's available.



  • @Paul-Winterhalder fingers crossed