优化
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
package com.baiyue.common.event;
|
||||
|
||||
/** Required business state has not arrived yet; retry the same event with backoff. */
|
||||
public class EventDependencyNotReadyException extends IllegalArgumentException {
|
||||
public EventDependencyNotReadyException(String message) { super(message); }
|
||||
public EventDependencyNotReadyException(String message, Throwable cause) { super(message, cause); }
|
||||
}
|
||||
+1
-1
@@ -75,7 +75,7 @@ public final class EventEnvelopeValidator {
|
||||
public static void requireValid(EventEnvelope envelope) {
|
||||
List<String> errors = validate(envelope);
|
||||
if (!errors.isEmpty()) {
|
||||
throw new IllegalArgumentException(String.join(";", errors));
|
||||
throw new EventProtocolException(String.join(";", errors));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.baiyue.common.event;
|
||||
|
||||
/** An immutable event violates the consumption protocol; retrying unchanged data cannot fix it. */
|
||||
public class EventProtocolException extends IllegalArgumentException {
|
||||
public EventProtocolException(String message) { super(message); }
|
||||
public EventProtocolException(String message, Throwable cause) { super(message, cause); }
|
||||
}
|
||||
Reference in New Issue
Block a user