Update Exception API
- Introduce a DuplicateOrderLineException to signal whenever somebody wants to add the same product twice instead of using the increment command. - Introduce OrderAlreadyConfirmedException to signal whenever the order is confirmed, so that adding products and incrementing/decrementing their count is not possible once the order has been confirmed #BAEL-4767
This commit is contained in:
parent
2b2aff5ceb
commit
ef1167b037
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.axon.coreapi.exceptions;
|
||||
|
||||
public class DuplicateOrderLineException extends IllegalStateException {
|
||||
|
||||
public DuplicateOrderLineException(String productId) {
|
||||
super("Cannot duplicate order line for product identifier [" + productId + "]");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.axon.coreapi.exceptions;
|
||||
|
||||
public class OrderAlreadyConfirmedException extends IllegalStateException {
|
||||
|
||||
public OrderAlreadyConfirmedException(String orderId) {
|
||||
super("Cannot perform operation because order [" + orderId + "] is already confirmed.");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue