diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2017-08-18 09:34:16 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2018-03-27 20:34:27 +0000 |
commit | 41ea301886adf58cb6eb7aef138cc344af875ef9 (patch) | |
tree | 96a22d9cabe11468933b5d3612a32b66acbc93f7 | |
parent | b5100e7b19909673199ac27875d72c4949a0604d (diff) | |
download | libmojo-41ea301886adf58cb6eb7aef138cc344af875ef9.tar.gz |
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
-rw-r--r-- | mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl | 7 |
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; |