ursus
05/22/2020, 2:58 AMpromoCodeGenerationCountExceeded
is false when it should be truenkiesel
05/22/2020, 3:33 AM,
and $path
) but that should not make a differencenkiesel
05/22/2020, 3:35 AMget()
and you could just use val promoCodeGenerationCountExceeded = errorCode == 400 && errorMessage == "PROMO_CODE_COUNT_EXCEEDED"
but I guess the real code is more complex and allows mutating the values?ursus
05/22/2020, 4:57 AMursus
05/22/2020, 4:58 AMursus
05/22/2020, 4:59 AMursus
05/22/2020, 4:59 AMnkiesel
05/22/2020, 5:56 AMnkiesel
05/22/2020, 5:57 AMclass ApiException(
val errorCode: Int,
val errorMessage: String?
) : RuntimeException(", code '$errorCode', message '$errorMessage'") {
val promoCodeGenerationCountExceeded
get() = errorCode == 400 && errorMessage == "PROMO_CODE_COUNT_EXCEEDED"
}
ApiException(400, "PROMO_CODE_COUNT_EXCEEDED").promoCodeGenerationCountExceeded
nkiesel
05/22/2020, 5:57 AMtrue
for menkiesel
05/22/2020, 6:00 AMpath
and extra ,
ursus
05/22/2020, 7:03 AMnkiesel
05/22/2020, 7:11 AMnkiesel
05/22/2020, 7:12 AM()
made a difference