From 69217753cc9ed07b8e2910d22c66d730e9d11f9a Mon Sep 17 00:00:00 2001
From: BMItter <Berndus@gmx.de>
Date: Wed, 23 Jun 2021 08:50:18 +0200
Subject: [PATCH] Exception forwarding / error message 403 (EXPOSUREAPP-8022 )
 (#3524)

* Forward TestCertificateServerException

* satisfy noOne but lint

Co-authored-by: Chilja Gossow <49635654+chiljamgossow@users.noreply.github.com>
---
 .../test/core/server/TestCertificateServer.kt                | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/covidcertificate/test/core/server/TestCertificateServer.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/covidcertificate/test/core/server/TestCertificateServer.kt
index 436df40c3..019bf6ba4 100644
--- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/covidcertificate/test/core/server/TestCertificateServer.kt
+++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/covidcertificate/test/core/server/TestCertificateServer.kt
@@ -68,7 +68,10 @@ class TestCertificateServer @Inject constructor(
             }
         } catch (e: Exception) {
             Timber.tag(TAG).w(e, "registerPublicKeyForTest failed")
-            throw TestCertificateServerException(PKR_FAILED)
+            throw when (e) {
+                is TestCertificateServerException -> e
+                else -> TestCertificateServerException(PKR_FAILED)
+            }
         }
     }
 
-- 
GitLab