libmojo: Add one more callback exception handler
Upon further inspection, there is one more callback invocation site
where we want to handle exceptions from.
Bug: 28986534
Bug: 64805573
Bug: 73005146
Test: m
Change-Id: I021ff2111e000eee4e9242afd87ad3b4420f6119
Merged-In: I021ff2111e000eee4e9242afd87ad3b4420f6119
(cherry picked from commit 41ea301886adf58cb6eb7aef138cc344af875ef9)
diff --git a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
index ba31186..a723f8c 100644
--- a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
@@ -246,7 +246,12 @@
{% if method.response_parameters|length %}
{{response_struct|name}} response = {{response_struct|name}}.deserialize(messageWithHeader.getPayload());
{% endif %}
- mCallback.call({{run_callback('response', method.response_parameters)}});
+ try {
+ mCallback.call({{run_callback('response', method.response_parameters)}});
+ } catch (RuntimeException e) {
+ // TODO(lhchavez): Remove this hack. See b/28814913 for details.
+ android.util.Log.wtf("{{namespace}}.{{interface.name}}", "Uncaught runtime exception", e);
+ }
return true;
} catch (org.chromium.mojo.bindings.DeserializationException e) {
return false;