From dddb7ece25a6afb351a34890699b3d3bb6bb99d2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 18 Jun 2020 20:37:56 +0200 Subject: [PATCH] show app failure instead of crashing when egl fails to init. fixes #3795 --- .../conversations/xmpp/jingle/WebRTCWrapper.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index 4e5fc2641..ff7e6a677 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -214,9 +214,13 @@ public class WebRTCWrapper { PeerConnectionFactory.InitializationOptions.builder(service).createInitializationOptions() ); } catch (final UnsatisfiedLinkError e) { - throw new InitializationException(e); + throw new InitializationException("Unable to initialize PeerConnectionFactory", e); + } + try { + this.eglBase = EglBase.create(); + } catch (final RuntimeException e) { + throw new InitializationException("Unable to create EGL base", e); } - this.eglBase = EglBase.create(); this.context = service; this.toneManager = service.getJingleConnectionManager().toneManager; mainHandler.post(() -> { @@ -589,8 +593,8 @@ public class WebRTCWrapper { static class InitializationException extends Exception { - private InitializationException(final Throwable throwable) { - super(throwable); + private InitializationException(final String message, final Throwable throwable) { + super(message, throwable); } private InitializationException(final String message) {