From de3dbe3b364ede2000a25edd0d3bd397bf657e81 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Mon, 22 Mar 2021 10:37:06 +0100 Subject: [PATCH] Better exception --- .../keepass/database/file/output/DatabaseOutputKDB.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/database/file/output/DatabaseOutputKDB.kt b/app/src/main/java/com/kunzisoft/keepass/database/file/output/DatabaseOutputKDB.kt index 57a6a835d..8d3b9547b 100644 --- a/app/src/main/java/com/kunzisoft/keepass/database/file/output/DatabaseOutputKDB.kt +++ b/app/src/main/java/com/kunzisoft/keepass/database/file/output/DatabaseOutputKDB.kt @@ -70,14 +70,8 @@ class DatabaseOutputKDB(private val mDatabaseKDB: DatabaseKDB, .cipherEngine.getCipher(Cipher.ENCRYPT_MODE, finalKey ?: ByteArray(0), header.encryptionIV) - } catch (e1: NoSuchAlgorithmException) { - throw IOException("No such algorithm") - } catch (e1: NoSuchPaddingException) { - throw IOException("No such padding") - } catch (e1: InvalidKeyException) { - throw IOException("Invalid key") - } catch (e1: InvalidAlgorithmParameterException) { - throw IOException("Invalid algorithm parameter.") + } catch (e: Exception) { + throw IOException("Algorithm not supported.", e) } try {