Skip to content

Commit

Permalink
Merge pull request #2119 from Infomaniak/api-errors
Browse files Browse the repository at this point in the history
fix: API errors
  • Loading branch information
KevinBoulongne authored Dec 10, 2024
2 parents ecaa759 + 7ac1e5f commit 77a1776
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ class RefreshController @Inject constructor(
"3_folderId" to folder.id,
"5_deleted" to activities.deletedShortUids.map { it },
"6_updated" to activities.updatedMessages.map { it.shortUid },
"7_updated" to activities.addedShortUids.map { it },
"7_added" to activities.addedShortUids.map { it },
),
)
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/infomaniak/mail/utils/ErrorCode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ object ErrorCode {
//region Mailbox
const val MAILBOX_LOCKED = "mailbox_locked"
const val ACCESS_DENIED = "access_denied"
const val NOT_AUTHORIZED = "not_authorized"
const val ERROR_WHILE_LINKING_MAILBOX = "error_while_linking_mailbox"
const val INVALID_MAILBOX_PASSWORD = "invalid_mailbox_password"
//endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class FetchMessagesManager @Inject constructor(
private fun shouldLogToSentry(throwable: Throwable?): Boolean {
return when (throwable) {
is CancellationException, is NetworkException -> false
is ApiErrorException -> throwable.errorCode != ErrorCode.ACCESS_DENIED
is ApiErrorException -> {
throwable.errorCode != ErrorCode.ACCESS_DENIED && throwable.errorCode != ErrorCode.NOT_AUTHORIZED
}
else -> true
}
}
Expand Down

0 comments on commit 77a1776

Please sign in to comment.