Forum Discussion

Arthy74's avatar
Arthy74
Visitor
9 years ago

Capture Runtime errors for Scene Graph

Hey everyone,

I am using the Eval technique to catch errors to have a friendly app crash message.

If an error happens in the render thread, i correctly capture the Eval result, and then i am able to do something.

But i just noticed that if the error happens in the render thread (Scene Graph), the app just crash and does not fall back as the eval result.

Am i missing something ?
And does roku have plans to give us a decent api to track runtime crashes ?

3 Replies

  • I don't believe eval() is thread-safe. My advice is to use it very, very sparingly - and only in one of the threads. Or bad things may happen. 
    Oh, and also do not call eval() in a loop, like hundreds or thousands of times - bad things will happen.
  • Ok, do you know a way to you use Eval() on the render thread (Scene Graph) ?
  • You should be fine if you understand and follow what i said above.

    But let me underline that the render thread uh, renders 60 times per second. You cannot do eval() at 60Hz if you intend your app to live more than a second or two (like i said, nothing good will happen invoking eval in a loop).

    What exactly are you trying to fence with eval() in the RSG thread?! eval() is no excuse for sloppiness in coding and as a rule, "fatal" errors only occur due to errors in your code semantics - not Roku's.