manishDev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2018
04:26 PM
catching runtime error
Any idea how one can catch runtime errors? I want to show a message to the user when any unexpected error occurs. This can be my way of error handling. I can even take the control back a couple of steps to redo whatever function was trying to.
4 REPLIES 4

georgejecook
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2018
05:55 PM
Re: catching runtime error
use Eval to run the code, and check the result. I do this on some high risk code. Used occasionally and with caution, it can be handy. Other than that, use rodash, or similar library for getting chained objects e.g. a.b.c.value
https://forums.roku.com/viewtopic.php?f ... hilit=eval
https://github.com/Tubitv/rodash
https://forums.roku.com/viewtopic.php?f ... hilit=eval
https://github.com/Tubitv/rodash
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
manishDev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018
12:28 PM
Re: catching runtime error
"georgejecook" wrote:
use Eval to run the code, and check the result. I do this on some high risk code. Used occasionally and with caution, it can be handy. Other than that, use rodash, or similar library for getting chained objects e.g. a.b.c.value
https://forums.roku.com/viewtopic.php?f ... hilit=eval
https://github.com/Tubitv/rodash
Thanks George. I am thinking of using Eval to do all my risky operations. Sounds like a reasonable approach. I avoid using chained values. I usually get my data bound to interfaces and have listeners on them to catch them into a local data. That way with a single rendezvous I can propagate variable repo to all files with minimum access to global node. Rodash library looks great. I will dive deeper and have a look at it.

georgejecook
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018
03:00 PM
Re: catching runtime error
glad it worked out. Yeah, I'm not fan of chained access - I have a pattern whereby I do all that in my takss; but even then, I can never be sure I got the json right from the server, so I use rodash.get() to avoid crashes in those circumstances. don't over use/abuse eval!! There are smarter people here than me, who can tell you why.
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
manishDev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2018
06:44 AM
Re: catching runtime error
"georgejecook" wrote:
glad it worked out. Yeah, I'm not fan of chained access - I have a pattern whereby I do all that in my takss; but even then, I can never be sure I got the json right from the server, so I use rodash.get() to avoid crashes in those circumstances. don't over use/abuse eval!! There are smarter people here than me, who can tell you why.
That's right. I have seen some other posts where devs have mentioned it. Somehow I feel it was easy to use in the SDK1. But I don't know any better. I never worked on SDK1.