Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 71376d5

Browse files
committed
Handle all Exceptions when error occurred during checking api connection
1 parent 0da32fa commit 71376d5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package dev.medzik.librepass.client.api
22

3-
import com.google.gson.JsonSyntaxException
43
import dev.medzik.librepass.client.Client
5-
import dev.medzik.librepass.client.errors.ApiException
64

75
/**
86
* Check connection with the API server.
@@ -15,9 +13,7 @@ fun checkApiConnection(apiUrl: String): Boolean {
1513
try {
1614
val response = client.get("/actuator/info")
1715
return response.contains("\"group\":\"dev.medzik.librepass\"")
18-
} catch (e: ApiException) {
19-
return false
20-
} catch (e: JsonSyntaxException) {
16+
} catch (e: Exception) {
2117
return false
2218
}
2319
}

0 commit comments

Comments
 (0)