OpenTreeMap / otm-android

An OpenTreeMap client for Android. The OpenTreeMap code can be downloaded at https://github.com/OpenTreeMap/otm-core.
Other
22 stars 22 forks source link

Suppressed exceptions for showing tree fields on empty planting sites #308

Open maurizi opened 7 years ago

maurizi commented 7 years ago

These exceptions are caught and the code does the right thing when they happen, but it would be better if they didn't happen at all.

02-03 09:55:10.326 28293-28293/org.azavea.otm.dev D/AZ_OTM: Could not find key: tree.species on plot/tree object
                                                            org.json.JSONException: No value for tree
                                                                at org.json.JSONObject.get(JSONObject.java:389)
                                                                at org.json.JSONObject.getJSONObject(JSONObject.java:609)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:93)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:54)
                                                                at org.azavea.otm.fields.ButtonField.renderForEdit(ButtonField.java:45)
                                                                at org.azavea.otm.fields.FieldGroup.render(FieldGroup.java:92)
                                                                at org.azavea.otm.fields.FieldGroup.renderForEdit(FieldGroup.java:124)
                                                                at org.azavea.otm.ui.TreeEditDisplay.initializeEditPage(TreeEditDisplay.java:159)
                                                                at org.azavea.otm.ui.TreeEditDisplay.onCreate(TreeEditDisplay.java:107)
                                                                at android.app.Activity.performCreate(Activity.java:6679)
                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                at android.os.Looper.loop(Looper.java:154)
                                                                at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
02-03 09:55:10.328 28293-28293/org.azavea.otm.dev D/AZ_OTM: Could not find key: tree.diameter on plot/tree object
                                                            org.json.JSONException: No value for tree
                                                                at org.json.JSONObject.get(JSONObject.java:389)
                                                                at org.json.JSONObject.getJSONObject(JSONObject.java:609)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:93)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:54)
                                                                at org.azavea.otm.fields.DiameterField.renderForEdit(DiameterField.java:32)
                                                                at org.azavea.otm.fields.FieldGroup.render(FieldGroup.java:92)
                                                                at org.azavea.otm.fields.FieldGroup.renderForEdit(FieldGroup.java:124)
                                                                at org.azavea.otm.ui.TreeEditDisplay.initializeEditPage(TreeEditDisplay.java:159)
                                                                at org.azavea.otm.ui.TreeEditDisplay.onCreate(TreeEditDisplay.java:107)
                                                                at android.app.Activity.performCreate(Activity.java:6679)
                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                at android.os.Looper.loop(Looper.java:154)
                                                                at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
02-03 09:55:10.338 28293-28293/org.azavea.otm.dev D/AZ_OTM: Could not find key: tree.date_planted on plot/tree object
                                                            org.json.JSONException: No value for tree
                                                                at org.json.JSONObject.get(JSONObject.java:389)
                                                                at org.json.JSONObject.getJSONObject(JSONObject.java:609)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:93)
                                                                at org.azavea.otm.data.Model.getValueForKey(Model.java:54)
                                                                at org.azavea.otm.fields.ButtonField.renderForEdit(ButtonField.java:45)
                                                                at org.azavea.otm.fields.FieldGroup.render(FieldGroup.java:92)
                                                                at org.azavea.otm.fields.FieldGroup.renderForEdit(FieldGroup.java:124)
                                                                at org.azavea.otm.ui.TreeEditDisplay.initializeEditPage(TreeEditDisplay.java:159)
                                                                at org.azavea.otm.ui.TreeEditDisplay.onCreate(TreeEditDisplay.java:107)
                                                                at android.app.Activity.performCreate(Activity.java:6679)
                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                at android.os.Looper.loop(Looper.java:154)
                                                                at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)