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