diff options
author | cyBerta <cyberta@riseup.net> | 2019-10-25 10:57:49 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-10-25 10:57:49 +0200 |
commit | 6b4f3597733ced8d312ed263d53b9669d6274d65 (patch) | |
tree | 045198efae0435910054a065b1304e7ddcf981c7 /app/src/main | |
parent | 02ffacb6b56fb02b0d58157123edf7b91380e3f8 (diff) |
handle errors during the initiation of a pt connection separately
only run-time errors, reported by connections will be handled
in shapeshifterErrorListner
(https://0xacab.org/leap/shapeshifter/issues/1)
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/pluggableTransports/Shapeshifter.java | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/Shapeshifter.java b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/Shapeshifter.java index 6d3b1db2..3fefb6e7 100644 --- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/Shapeshifter.java +++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/Shapeshifter.java @@ -33,8 +33,8 @@ public class Shapeshifter { public static final String DISPATCHER_IP = "127.0.0.1"; private static final String TAG = Shapeshifter.class.getSimpleName(); - ShapeShifter shapeShifter; - ShapeshifterErrorListner shapeshifterErrorListner; + private ShapeShifter shapeShifter; + private ShapeshifterErrorListner shapeshifterErrorListner; public interface ShapeshifterErrorListenerCallback { void onStarted(); @@ -53,25 +53,22 @@ public class Shapeshifter { } public void start() { - try { - ShapeshifterErrorListenerCallback errorListenerCallback = () -> { - ; - Handler handler = new Handler(Looper.getMainLooper()); - handler.postDelayed(() -> { - try { - Log.d(TAG, "shapeshifter open"); - shapeShifter.open(); - } catch (Exception e) { - e.printStackTrace(); - } - }, 200); - }; - shapeshifterErrorListner = new ShapeshifterErrorListner(errorListenerCallback); - shapeshifterErrorListner.execute(shapeShifter); - - } catch (Exception e) { - e.printStackTrace(); - } + ShapeshifterErrorListenerCallback errorListenerCallback = () -> { + ; + Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(() -> { + try { + Log.d(TAG, "shapeshifter open"); + shapeShifter.open(); + } catch (Exception e) { + Log.e(TAG, "SHAPESHIFTER ERROR: " + e.getLocalizedMessage()); + VpnStatus.logError(VpnStatus.ErrorType.SHAPESHIFTER); + VpnStatus.logError(e.getLocalizedMessage()); + } + }, 200); + }; + shapeshifterErrorListner = new ShapeshifterErrorListner(errorListenerCallback); + shapeshifterErrorListner.execute(shapeShifter); } public boolean stop() { |