Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
calin
Level 7

Global error logging to a api

Jump to solution

Hi,

I am new to channel development, in my current app I want to log all exceptions to the server.


I know that the language has support for try / catch but I can figure out if there a way to observer thrown exceptions and just log them before the app dies?

 

0 Kudos
1 Solution

Accepted Solutions
sjb64
Level 10

Re: Global error logging to a api

Jump to solution

You have no way to know the app is dying, and even if you could detect it, there is no allowance for an any clean up code on an app end in Brightscript.  There has been previous discussions and requests about detecting an app end and allowing some minimal time for clean up, but this isn't there and the reasoning from Roku (which makes sense) makes me think it is absolutely not going to happen.

Try/catch is currently your only option to my knowledge, and even it wont detect a reboot level error (a memory overflow for example), or the home button.

View solution in original post

1 REPLY 1\
sjb64
Level 10

Re: Global error logging to a api

Jump to solution

You have no way to know the app is dying, and even if you could detect it, there is no allowance for an any clean up code on an app end in Brightscript.  There has been previous discussions and requests about detecting an app end and allowing some minimal time for clean up, but this isn't there and the reasoning from Roku (which makes sense) makes me think it is absolutely not going to happen.

Try/catch is currently your only option to my knowledge, and even it wont detect a reboot level error (a memory overflow for example), or the home button.