Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Arthy74
Visitor

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 ?
0 Kudos
3 REPLIES 3
EnTerr
Roku Guru

Re: Capture Runtime errors for Scene Graph

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.
0 Kudos
Arthy74
Visitor

Re: Capture Runtime errors for Scene Graph

Ok, do you know a way to you use Eval() on the render thread (Scene Graph) ?
0 Kudos
EnTerr
Roku Guru

Re: Capture Runtime errors for 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.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.