diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2017-08-17 15:30:20 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2017-08-17 15:30:20 -0700 |
commit | efcc47419fdc92a33267f8a260bb336d97e49a45 (patch) | |
tree | 01380a858461e6344a300469e1e87fbfa0289e85 | |
parent | d15eec43b6fe3923c794d9e6d5b9a5d8d3012134 (diff) | |
download | libmojo-efcc47419fdc92a33267f8a260bb336d97e49a45.tar.gz |
libmojo: Catch more exceptions in callbacks
This change catches another place where unhandled exceptions would
become fatal for system_server: the QueryVersion callback. It instead
converts the exception into an WTF log.
Bug: 28986534
Bug: 64805573
Test: m
Change-Id: Ic1a0e9892b96839c7afa1244a33ff37c19962641
-rw-r--r-- | mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java index c2bbc8e..90fdb3a 100644 --- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java +++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Interface.java @@ -195,7 +195,13 @@ public interface Interface extends ConnectionErrorHandler, Closeable { @Override public void call(RunResponseMessageParams response) { mVersion = response.queryVersionResult.version; - callback.call(mVersion); + try { + callback.call(mVersion); + } catch (RuntimeException e) { + // TODO(lhchavez): Remove this hack. See b/28986534 for details. + android.util.Log.wtf("org.chromium.mojo.bindings.Interface", + "Uncaught runtime exception", e); + } } }); } |