Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fitbit OS response to untrapped errors

Does anyone know what the Fitbit OS causes the watch to do when it encounters an untrapped error during processing a clock event?

 

Does it cause a vibration?

 

How does one know when such an error has occurred? Or what it was?

 

Is there a log anywhere where one can retrieve a record of such exceptional cases?

 

Is there some recognise recovery procedure that all clock apps should implement?

Author | ch, passion for improvement.

Best Answer
0 Votes
5 REPLIES 5

I think the user sees a message like 'This clockface has encountered an error. Please choose a different clockface.' There isn't any additional logging info available.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks

 

Is there a recommended way to trap all errors before that happens and take remedial action?

 

And as part of trapping the errors is there a recommended way to report them or log them?

Author | ch, passion for improvement.

Best Answer
0 Votes

I don't know; that's a good question! You could wrap all your code in try...catch; that will pick up at least some things. At least a few issues (such as memory exhaustion) can't be caught, I suspect. You'd probably need separate try...catch blocks around each of your callback functions (eg, event handlers).

 

You could try this to get more logging.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks - very interesting link. Will try it.

 

I also have my own on watch log to which I could add messages, already visible on the watch by the user.

 

Its odd that errors [especially out of memory] are not automatically recorded by the Fitbit OS and reported to the phone app or something.

 

If the OS is already trapping all the errors anyway, adding TRY all over the place is largely redundant and will only inflate and complicate the code and is more likely to get an out of memory situation sooner, so unless essential is probably undesirable.

 

Hence the greater need to have access to the OS error reporting which is outside the app memory limit. Similar to the Console log in the Simulator.

 

Maybe a new feature.

 

I believe that console.log statements are removed by default from published apps? May be there should be an option to leave them in for the new feature?

 

Author | ch, passion for improvement.

Best Answer
0 Votes

I totally agree. I only suggested trapping errors in your own code so you can get info that isn't otherwise available to you. It would certainly be cleaner if it were just done once.

 

Of course, trapping your own errors opens up possibilities for recovery or graceful degradation, which the operating system can't provide. But that's another story.

Peter McLennan
Gondwana Software
Best Answer
0 Votes