Júlio Santos
02/24/2023, 3:19 PMif (ex !is PayInProcessException || ex.errorCode == PayInServiceErrorCode.PAYMENT_PROCESS_UNAVAILABLE_ERROR || ex.errorCode == PayInServiceErrorCode.WALLET_SERVICE_ACCOUNT_NOT_FOUND) {
sendWorkerFailedMessage(ex, purchaseDto, walletDto, merchantDto, headerParam)
}
Joffrey
02/24/2023, 3:23 PMex !is PayInProcessException
seems strange to me. It seems the catch block should have dealt with the type in the first place. If a bunch of exceptions that are not PayInProcessException
share common processing, maybe they should have a common parent type you could check for? Maybe not, but more context would help decide here.Joffrey
02/24/2023, 3:24 PMSet
named based on the reason why they are treated the same, and checked with ex.errorCode in yourSet