mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
Show in-app error code for unknown errors
This commit is contained in:
@ -48,7 +48,10 @@ fun Context.sendMessageCompat(text: String, addresses: List<String>, subId: Int?
|
|||||||
when (e.errorCode) {
|
when (e.errorCode) {
|
||||||
EMPTY_DESTINATION_ADDRESS -> toast(id = R.string.empty_destination_address, length = LENGTH_LONG)
|
EMPTY_DESTINATION_ADDRESS -> toast(id = R.string.empty_destination_address, length = LENGTH_LONG)
|
||||||
ERROR_PERSISTING_MESSAGE -> toast(id = R.string.unable_to_save_message, length = LENGTH_LONG)
|
ERROR_PERSISTING_MESSAGE -> toast(id = R.string.unable_to_save_message, length = LENGTH_LONG)
|
||||||
ERROR_SENDING_MESSAGE -> toast(id = R.string.unknown_error_occurred, length = LENGTH_LONG)
|
ERROR_SENDING_MESSAGE -> toast(
|
||||||
|
msg = getString(R.string.unknown_error_occurred_sending_message, e.errorCode),
|
||||||
|
length = LENGTH_LONG
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
|
@ -2,8 +2,8 @@ package com.simplemobiletools.smsmessenger.messaging
|
|||||||
|
|
||||||
class SmsException(val errorCode: Int, val exception: Exception? = null) : Exception() {
|
class SmsException(val errorCode: Int, val exception: Exception? = null) : Exception() {
|
||||||
companion object {
|
companion object {
|
||||||
const val EMPTY_DESTINATION_ADDRESS = 0
|
const val EMPTY_DESTINATION_ADDRESS = -1
|
||||||
const val ERROR_PERSISTING_MESSAGE = 1
|
const val ERROR_PERSISTING_MESSAGE = -2
|
||||||
const val ERROR_SENDING_MESSAGE = 2
|
const val ERROR_SENDING_MESSAGE = -3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user