Try/Catch block fails to catch "Error: Symbol Not Found Error" noted in CIQ_LOG.YML - alternate approaches?

Former Member
Former Member

Hello.  I have a working Garmin watch app receiving direct messages from the connected phone in the form of a dictionary.  This method works well when the dictionary is well defined.  I am deliberately sending a corrupted dictionary to ensure our Garmin watch app gracefully handles bad messages.  I have a "try/catch" block which handles some exceptions but doesn't handle the case when the dictionary is not present (e.g. it's just a string var).  I've tried both "e instanceof Lang.Exception" in the catch as well as what I assumed would catch all "catch (e)" - please see the below code snippet.

The exception log error in CIQ_LOG.YML (below also) is:

Error: Symbol Not Found Error

Details: Could not find symbol get.

How can I catch this type of error?

Thanks

////////////////////////////////////////////////////////

    // decode message dictionary

    function decodePhoneMessage(msg_dict) {

       try {

              // try dictionary access

              var name = msg_dict.get("productName");

              :

              return true;

       }

//     catch (e instanceof Lang.Exception) {

       catch (e) {

              System.println("onPhone msg exception! " + e.getErrorMessage());

       }

       return false;

    }

 

Error: Symbol Not Found Error

Details: Could not find symbol get.

Time: 2019-08-26T18:34:36Z

Part-Number: 006-B2604-00

Firmware-Version: '14.10'

Language-Code: eng

ConnectIQ-Version: 3.0.12