NewbyDeveloper
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015
03:55 AM
Error Log
Hi
Is there a way that you can trap any run time BrightScript errors and write them to a log so you see the same information you get when debuging with Telnet?
Reason for asking..
I'm just wondering what happens if a channel is released if an error/crash happens for a user - you would get a complaint but nothing to go on to help fix it?
If you could trap and log any error (perhaps to your own web site with a URL call?) at least you'd know what caused it?
Is there a way that you can trap any run time BrightScript errors and write them to a log so you see the same information you get when debuging with Telnet?
Reason for asking..
I'm just wondering what happens if a channel is released if an error/crash happens for a user - you would get a complaint but nothing to go on to help fix it?
If you could trap and log any error (perhaps to your own web site with a URL call?) at least you'd know what caused it?
9 REPLIES 9
![Komag Komag](https://i.imgur.com/kaEvhbH.jpg)
Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015
04:20 AM
Re: Error Log
You could code in places to send a ton of "diagnostic" information periodically, then at least if you got a user with a crash or problem you would have something, not the official Brightscript errors but some information.
![TheEndless TheEndless](http://roku.permanence.com/images/sandman_endless_100x100.gif)
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015
05:54 PM
Re: Error Log
There's nothing (realistic) built into BrightScript. Roku does get crash dumps for crashing channels, so if you're getting a lot of reports, it may be possible to get them to generate a report for you.
I say "realistic" because technically you could use the Run and/or Eval functions to run code that will allow you to capture errors without crashing, but I wouldn't recommend that.
I say "realistic" because technically you could use the Run and/or Eval functions to run code that will allow you to capture errors without crashing, but I wouldn't recommend that.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
NewbyDeveloper
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015
06:45 AM
Re: Error Log
Thanks - just thinking back to when I used to write Basic years ago - there was an "On Error" function you could use.
So there's nothing like that in Brightscript?
So there's nothing like that in Brightscript?
![TheEndless TheEndless](http://roku.permanence.com/images/sandman_endless_100x100.gif)
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015
10:16 AM
Re: Error Log
"NewbyDeveloper" wrote:
Thanks - just thinking back to when I used to write Basic years ago - there was an "On Error" function you could use.
So there's nothing like that in Brightscript?
Unfortunately not.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
NewbyDeveloper
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015
12:36 PM
Re: Error Log
Thanks for taking time to reply.
Just out of interest.... scouring the net I found some ROKU PDF that refers to Brightsign BrightScript....
and it has this in....which doesn't work .... but just adds to the confusion I guess .... an Older version of Brightscript perhaps???
ON ERROR GOTO line number
When the Interpreter encounters any kind of error in your program, it normally breaks out of execution and
prints an error message. With ON ERROR GOTO, you can set up an error-trapping routine, which will allow
your program to "recover" from an error and continue, without any break in execution. Normally you have a
particular type of error in mind when you use the ON ERROR GOTO statement. For example, suppose your
program performs some division operations and you have not ruled out the possibility of division by zero.
You might want to write a routine to handle a division-by-zero error, and then use ON ERROR GOTO to
branch to that routine when such an error occurs.
Example:
5 ON ERROR GOTO 100
10 C = 1/0
The error handling routine must be terminated by a RESUME statement. See RESUME.
Just out of interest.... scouring the net I found some ROKU PDF that refers to Brightsign BrightScript....
and it has this in....which doesn't work .... but just adds to the confusion I guess .... an Older version of Brightscript perhaps???
ON ERROR GOTO line number
When the Interpreter encounters any kind of error in your program, it normally breaks out of execution and
prints an error message. With ON ERROR GOTO, you can set up an error-trapping routine, which will allow
your program to "recover" from an error and continue, without any break in execution. Normally you have a
particular type of error in mind when you use the ON ERROR GOTO statement. For example, suppose your
program performs some division operations and you have not ruled out the possibility of division by zero.
You might want to write a routine to handle a division-by-zero error, and then use ON ERROR GOTO to
branch to that routine when such an error occurs.
Example:
5 ON ERROR GOTO 100
10 C = 1/0
The error handling routine must be terminated by a RESUME statement. See RESUME.
![TheEndless TheEndless](http://roku.permanence.com/images/sandman_endless_100x100.gif)
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2015
01:22 PM
Re: Error Log
"NewbyDeveloper" wrote:
Just out of interest.... scouring the net I found some ROKU PDF that refers to Brightsign BrightScript....
and it has this in....which doesn't work .... but just adds to the confusion I guess .... an Older version of Brightscript perhaps???
Not an older version of BrightScript.. a different version of BrightScript for the BrightSign line of products.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
![SolveLLC SolveLLC](http://channels.roku.com/images/13d8aca38e184cd1831565a8029dd58b-hd.jpg)
SolveLLC
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2016
05:59 PM
Re: Error Log
This would be very helpful. I'm introducing some code that previously crashed under certain circumstances from external data that I can't control. It would be great if we could have some sort of reporting on crash.
tim_beynart
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2016
03:08 PM
Re: Error Log
Try... catch sure would be nice, right? *sigh*
We use tons of if/then and remote calls to Splunk to log the predictable failures, but that's not exactly the same thing as exception handling.
We use tons of if/then and remote calls to Splunk to log the predictable failures, but that's not exactly the same thing as exception handling.
JesUltra
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024
09:32 PM
Re: Error Log, new methods available since Roku OS 9.4 / 13
For the benefit of other people finding this thread, I would like to state that on top of the actual TRY / CATCH which was added in Roku OS 9.4, starting with version 13, we now also have GetLastExitInfo(), that allows your channel to get the last 20 log messages along with other information about previous crashes, which it could then use to upload to your servers.