Community Health Toolkit

Different types of errors in feedback docs

While parsing through some feedback docs, I noticed a few different formats that errors take in the docs. Some are classified as errors in a ‘log’ section and have a stack, some are in the ‘log’ section without a stack, and some are just uncaught exceptions in an ‘info’ section. All of the last type that I have seen are pointing to the same line as well. Does each different type mark a different type of error or have some sort of other significance, or are they all just errors caught at different points in the execution? I’ve included a few examples below for reference:

{"_id": “c58dbdd0-2c0a-4a0f-975b-b89eb5d1cd15”, “log”: [
{“level”: “error”, “arguments”: “{“0”:“Execption thrown in JavascriptInterface function: java.lang.SecurityException: Sending SMS message: uid 10095 does not have android.permission.SEND_SMS.; at android.os.Parcel.readException(Parcel.java:1599); at android.os.Parcel.readException(Parcel.java:1552); at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:1190); at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:353); at android.telephony.SmsManager.sendTextMessage(SmsManager.java:322); at android.telephony.SmsManager.sendMultipartTextMessageInternal(SmsManager.java:570); at android.telephony.SmsManager.sendMultipartTextMessage(SmsManager.java:517); at org.medicmobile.webapp.mobile.j.sms_send(MedicAndroidJavascript.java:2063); at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method); at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39); at android.os.Handler.dispatchMessage(Handler.java:111); at android.os.Looper.loop(Looper.java:207); at android.os.HandlerThread.run(HandlerThread.java:61); “}”}, “_rev”: “1-99a32061a26f5c91d29aa361d76aa8dd”, “info”: {“file”: “pih-malawi.app.medicmobile/medic/_design/medic/_rewrite/js/inbox.js”, “line”: 3, “message”: “Uncaught TypeError: Cannot read property ‘scrollIntoView’ of undefined”}, “meta”: {“app”: “medic”, “url”: “pih-malawi.app.medicmobile/medic/_design/medic/_rewrite/#/tasks/fa0b4811-5f58-4160-9051-0d2311c139bd-ncd-referral-follow-up”, “time”: “2020-03-08T15:21:24.939Z”, “user”: {“name”: “-----”, “roles”: [”-----”]}, “source”: “automatic”, “version”: “3.4.0”}, “type”: “feedback”}

{"_id": “5f1d8f95-49a2-4029-b78b-e95dce31b25e”, “log”: [{“level”: “error”, “arguments”: “{“0”:“The select2(‘data’) method was called on an element that is not using Select2.”}”}, “_rev”: “1-695249fc918d0c60c5a6362c17a4496e”, “info”: {“file”: “muso-mali.app.medicmobile/medic/_design/medic/_rewrite/js/inbox.js”, “line”: 3, “message”: “Uncaught TypeError: Cannot read property ‘scrollIntoView’ of undefined”}, “meta”: {“url”: “muso-mali.app.medicmobile/medic/_design/medic/_rewrite/#/tasks/1596fc09-1e2a-4735-bd7d-deea6dd26d1c~3~patient_assessment_yields_malnutrition_follow_up”, “time”: “2019-07-05T18:44:39.756Z”, “user”: {“name”: “------”, “roles”: ["------"]}}, “type”: “feedback”}

{"_id": “dae23241-fd50-42cb-93b0-5b325886dd74”, “log”: [], “_rev”: “1-8390c6a0d939f54c552e012a4987a440”, “info”: {“file”: “muso-mali.app.medicmobile/medic/_design/medic/_rewrite/js/inbox.js”, “line”: 3, “message”: “Uncaught InvalidStateError: Failed to execute ‘index’ on ‘IDBObjectStore’: The transaction has finished.”}, “meta”: {“url”: “muso-mali.app.medicmobile/medic/_design/medic/_rewrite/#/about”, “time”: “2019-07-05T12:04:00.056Z”, “user”: {“name”: “-----”, “roles”: ["-------"]}}, “type”: “feedback”}

1 Like

Hi @Ethan .

The log property stores the last 20 lines that were written to console in an attempt to give more context about what may have been going on at the time. When this is empty (as in your third example) it’s probably because the error happened immediately at startup and nothing had been written to the console yet. That specific error looks to be a DB issue which can happen early in the app loading workflow so it’s logical that the log would be empty.

Because the log has the last 20 lines the ones with stack traces may in fact be completely unrelated to the error that this doc represents.

The most important property to look at is the message property which contains the information about this specific error and may or may not contain the stack that was caught.

2 Likes