From bed11276b9a82c6fbf7cd611f4e69ebe639c1384 Mon Sep 17 00:00:00 2001 From: Mygod Date: Wed, 31 Jul 2019 08:47:08 +0800 Subject: [PATCH] Refine error report --- mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt index db6fab62..efdf895e 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt @@ -59,10 +59,10 @@ abstract class RoutingManager(private val caller: Any, val downstream: String, p if (isWifi) WifiDoubleLock.acquire(this) } - fun start() = when (active.putIfAbsentCompat(downstream, this)) { + fun start() = when (val other = active.putIfAbsentCompat(downstream, this)) { null -> initRouting() this -> true // already started - else -> throw IllegalStateException("Double routing detected from $caller") + else -> throw IllegalStateException("Double routing detected for $downstream from $caller != ${other.caller}") } private fun initRouting() = try {