Show in-app error code for unknown errors
This commit is contained in:
parent
06f6a9ae05
commit
9a515d7fd0
|
@ -48,7 +48,10 @@ fun Context.sendMessageCompat(text: String, addresses: List<String>, subId: Int?
|
|||
when (e.errorCode) {
|
||||
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_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) {
|
||||
showErrorToast(e)
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simplemobiletools.smsmessenger.messaging
|
|||
|
||||
class SmsException(val errorCode: Int, val exception: Exception? = null) : Exception() {
|
||||
companion object {
|
||||
const val EMPTY_DESTINATION_ADDRESS = 0
|
||||
const val ERROR_PERSISTING_MESSAGE = 1
|
||||
const val ERROR_SENDING_MESSAGE = 2
|
||||
const val EMPTY_DESTINATION_ADDRESS = -1
|
||||
const val ERROR_PERSISTING_MESSAGE = -2
|
||||
const val ERROR_SENDING_MESSAGE = -3
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue