From 3c4a5064b05313b26a540c36b25b4808e1cffb06 Mon Sep 17 00:00:00 2001 From: Maxence G Date: Tue, 25 May 2021 19:30:02 +0200 Subject: [PATCH] change exception type --- .../org/moire/ultrasonic/fragment/EditServerFragment.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/EditServerFragment.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/EditServerFragment.kt index c7d009fa..978f6bf3 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/EditServerFragment.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/EditServerFragment.kt @@ -29,6 +29,7 @@ import org.moire.ultrasonic.util.ErrorDialog import org.moire.ultrasonic.util.ModalBackgroundTask import org.moire.ultrasonic.util.Util import timber.log.Timber +import java.io.IOException /** * Displays a form where server settings can be created / edited @@ -344,7 +345,7 @@ class EditServerFragment : Fragment(), OnBackPressedHandler { currentServerSetting!!.chatSupport = try { subsonicApiClient.api.getChatMessages().execute() true - } catch (e: Throwable) { false } + } catch (e: IOException) { false } updateProgress( String.format( @@ -357,7 +358,7 @@ class EditServerFragment : Fragment(), OnBackPressedHandler { currentServerSetting!!.bookmarkSupport = try { subsonicApiClient.api.getBookmarks().execute() true - } catch (e: Throwable) { false } + } catch (e: IOException) { false } updateProgress( String.format( @@ -371,7 +372,7 @@ class EditServerFragment : Fragment(), OnBackPressedHandler { currentServerSetting!!.shareSupport = try { subsonicApiClient.api.getShares().execute() true - } catch (e: Throwable) { false } + } catch (e: IOException) { false } updateProgress( String.format( @@ -386,7 +387,7 @@ class EditServerFragment : Fragment(), OnBackPressedHandler { currentServerSetting!!.podcastSupport = try { subsonicApiClient.api.getPodcasts().execute() true - } catch (e: Throwable) { false } + } catch (e: IOException) { false } // Finalize String before displaying it to Dialog progressString = String.format(