ERA report error in try/catch

Does an ERA error report on a line inside a try/catch block indicate the app crashed, or that the try/catch caught it gracefully?

  • Hi,

    I use the txt file approach. Sadly the user does have to create this as no real file system on Garmin. I use println and also a menu item to turn on various levels of debug.

    Regards,

    David

  • How do you find out the name of your app on the watch (APPS/ABC123.prg)  to tell your user to create (APPS/LOGS/ABC123.txt)?  

  • There's a few ways to do this (I recommend 3).

    1) If your app has already crashed on their device:

    - Have them open GARMIN/APPS/LOGS/CIQ_LOG.YML in a text editor like TextEdit, and search for your app name. If it's not there, have them look in CIQ_LOG.BAK

    - The filename will be in the log entry for the app crash

    2) By looking at the dates of their PRG files

    - Have them update your app and only your app.

    - Open /GARMIN/APPS

    - Sort folder in reverse order by date modified

    - The most recent PRG file (with a date/time close to now) will be your app

    This may not work for certain types of apps on watches that support music, since in this case, the app is moved to encrypted storage which isn't accessible to the end user

    3) By looking at garmindevice.xml

    Have them:

    - Open up /GARMIN/GARMINDEVICE.XML with Chrome

    - Search for the app name (the one compiled into the PRG, not the app store app name) with CMD-F (or CTRL-F on Windows)

    They'll see something like this:

  • Thanks, I suspected it might be as complex as that.

    Method 3 works quite well when I opened the .xml with Chrome, but then I remember I have previously installed an XML reader extension.

    I assumed the file name is varies across devices and installs.

    Did you find this file by trial'n'error?

  • Method 3 works quite well when I opened the .xml with Chrome, but then I remember I have previously installed an XML reader extension.

    Thanks, that's a much better idea than opening it with a text editor, as it will be formatted in a way that's much easier to read and find things (as opposed to having everything on a single line). For example, it will be clear which part of the file is a list of apps, and it will be super obvious which filename goes with which app.

    This way they can just press CMD-F, search for the app name, and the corresponding file name will be apparent.

    It works fine for me with Chrome, without installing an XML reader extension.

    I assumed the file name is varies across devices and installs.

    I think so. If you only update an app (as opposing to uninstalling and reinstalling it), I think the filename stays the same.

    Did you find this file by trial'n'error?

    It's been a while since I first opened it, so...maybe? I think I first opened it of my own volition, out of curiosity, to see what was inside, although I'm sure people have discussed it here in the past. I don't think it's documented by Garmin, if that's what you're wondering. It probably is pretty frustrating to read the Garmin docs suggesting that you should create a text file with the same filename as the app, but which don't tell you how to determine the app filename in the first place.

  • It probably is pretty frustrating to read the Garmin docs suggesting that you should create a text file with the same filename as the app,

    You are not wrong there!

    Thanks

  • It probably is pretty frustrating

    I have just solved my other issue - the side-loaded app not writing to the LOG file.

    There's been a change in the way the program file appears when side-loaded. Previously it was named with the app name (in my case: raceQs.prg). Now, I find it has acquired the name of the previously installed App Store version of the app (4C065B22.PRG), and the 4C065B22.TXT file is being written to. So wins all round!

    But now there's no reference to 4C065B22.PRG in GarminDevice.xml. 

    Curious.

  • It would be easy for Garmin to have a function to OpenDebug() that creates the txt file as needed.