Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
  1. Home
  2. Cloud Code
  3. Stacktrace for Cloud Code errors?

Stacktrace for Cloud Code errors?

Scheduled Pinned Locked Moved Cloud Code
cloud code scriptrhinocloud code
6 Posts 4 Posters 2.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Travis Brown-John
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    2
    • dhptD Offline
      dhptD Offline
      dhpt
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • Paul WinterhalderP Online
        Paul WinterhalderP Online
        Paul Winterhalder
        brainCloudAdmin
        wrote on last edited by
        #3

        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.

        A 1 Reply Last reply
        0
        • Paul WinterhalderP Paul Winterhalder

          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.

          A Offline
          A Offline
          Ali Raza
          wrote on last edited by
          #4

          @Paul-Winterhalder fingers crossed

          1 Reply Last reply
          0
          • dhptD Offline
            dhptD Offline
            dhpt
            wrote on last edited by
            #5

            I was just looking into this the other day, too! Like most issues in cloud script, it's a Rhino issue - you never know what isn't fully implemented, and the lacking IDE features doesn't let you know.

            What I did was ghetto, but it worked. In every script, I make an array that tracks stacktrace, then I try/catch everything. I rethrow until I get to my main func, where I funnel it to an err handler.

            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.

            The new Rhino release (already out) will even add ${} templating and backtick support~

            1 Reply Last reply
            0
            • Paul WinterhalderP Online
              Paul WinterhalderP Online
              Paul Winterhalder
              brainCloudAdmin
              wrote on last edited by
              #6

              Well - the new release isn't out yet - it's just a Release Candidate.

              https://github.com/mozilla/rhino/releases

              That said - we are very happy to see the progress - since it has been over a year since 1.7.13 was released!

              Hopefully soon!

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Solved
              • Unsolved
              • Users