George
11/10/2022, 3:10 PMfun updateOrderQuanity(orderId: OrderId, quantity: Int) {
require(quantity > 0) { "Quantity must be positive" }
val order = loadOrder(orderId)
order.quantity = quantity
storeOrder(order)
}
It is safe to assume that when we are creating a top-level-handler
Dedicate a single top-level place in your code to address all network errors uniformlyHere we actual also refer to
IOExceptions
and IllegalArgumentExceptions
(and any other input/output exceptions)?
Thanks in advance for any answers !George
11/10/2022, 3:10 PMIllegalArgumentException
as an input problem. For example: when someone sends a bad format dto we should/can throw IllegalArgumentException
. Probably that's why (imho) i think kotlinx.serialization also extends IllegalArgumentException
as the root if its exception hierarchy