From cb0e3297160aab7a2d1486aeeecdd92394eb220e Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:37:04 +0600 Subject: [PATCH] Fix wrong exception being caught after 8c480c6355 migration `android.database.sqlite.SQLiteException` instead of `android.database.SQLException` --- CHANGELOG.md | 2 ++ .../mihon/data/repository/ExtensionRepoRepositoryImpl.kt | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f11b6f2..8040c4ec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - `Other` - for technical stuff. ## [Unreleased] +### Fixed +- Fix app crashing when trying to add extension repo with existing signature ([@AntsyLich](https://github.com/AntsyLich)) ## [v0.19.5] - 2026-03-20 ### Changed diff --git a/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt b/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt index 24910d968..61c279630 100644 --- a/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt +++ b/data/src/main/java/mihon/data/repository/ExtensionRepoRepositoryImpl.kt @@ -1,6 +1,6 @@ package mihon.data.repository -import android.database.sqlite.SQLiteException +import android.database.SQLException import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map import mihon.domain.extensionrepo.exception.SaveExtensionRepoException @@ -42,7 +42,7 @@ class ExtensionRepoRepositoryImpl( ) { try { handler.await { extension_reposQueries.insert(baseUrl, name, shortName, website, signingKeyFingerprint) } - } catch (ex: SQLiteException) { + } catch (ex: SQLException) { throw SaveExtensionRepoException(ex) } } @@ -56,7 +56,7 @@ class ExtensionRepoRepositoryImpl( ) { try { handler.await { extension_reposQueries.upsert(baseUrl, name, shortName, website, signingKeyFingerprint) } - } catch (ex: SQLiteException) { + } catch (ex: SQLException) { throw SaveExtensionRepoException(ex) } }