Use log level exception for exceptions

Also log the exception itself instead of the localized message
concatinated in the log message.

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2022-06-23 15:00:13 +02:00
parent 8b9a204c40
commit 0f8830df89
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -161,14 +161,14 @@ class ChatAndCallMessagingService : FirebaseMessagingService() {
decryptMessage(privateKey, base64DecodedSubject, subject, signature)
}
} catch (e1: NoSuchAlgorithmException) {
Log.d(NotificationWorker.TAG, "No proper algorithm to decrypt the message " + e1.localizedMessage)
Log.e(NotificationWorker.TAG, "No proper algorithm to decrypt the message.", e1)
} catch (e1: NoSuchPaddingException) {
Log.d(NotificationWorker.TAG, "No proper padding to decrypt the message " + e1.localizedMessage)
Log.e(NotificationWorker.TAG, "No proper padding to decrypt the message.", e1)
} catch (e1: InvalidKeyException) {
Log.d(NotificationWorker.TAG, "Invalid private key " + e1.localizedMessage)
Log.e(NotificationWorker.TAG, "Invalid private key.", e1)
}
} catch (exception: Exception) {
Log.d(NotificationWorker.TAG, "Something went very wrong " + exception.localizedMessage, exception)
Log.e(NotificationWorker.TAG, "Something went very wrong!", exception)
}
}