aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Hector Chavez <lhchavez@google.com>2017-08-18 09:34:16 -0700
committerLuis Hector Chavez <lhchavez@google.com>2018-03-28 01:45:42 +0000
commitfd75f2cd95d4c37cb9ee3cc1c95a367b34b3da3c (patch)
tree549abfcae7e92a9c8e720cafc1e41d020e280d4b
parent2a234e6143cc20410d79ee276cdf3d158f16718d (diff)
downloadlibmojo-fd75f2cd95d4c37cb9ee3cc1c95a367b34b3da3c.tar.gz
libmojo: Add one more callback exception handlerpie-dev
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)
-rw-r--r--mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl7
1 files changed, 6 insertions, 1 deletions
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 @@ class {{interface|name}}_Internal {
{% 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;