@@ -26,6 +26,34 @@ public class ReplyException extends VertxException {
26
26
private final ReplyFailure failureType ;
27
27
private final int failureCode ;
28
28
29
+ /**
30
+ * Create a ReplyException with all attributes.
31
+ *
32
+ * @param failureType the failure type
33
+ * @param failureCode the failure code (e.g. 404)
34
+ * @param message the failure message
35
+ */
36
+ public ReplyException (ReplyFailure failureType , int failureCode , String message , boolean noStackTrace ) {
37
+ super (message , noStackTrace );
38
+ this .failureType = failureType ;
39
+ this .failureCode = failureCode ;
40
+ }
41
+
42
+ /**
43
+ * Create a ReplyException with all attributes, including cause.<br>
44
+ * Default {@link io.vertx.core.eventbus.impl.codecs.ReplyExceptionMessageCodec ReplyExceptionMessageCodec} doesn't support Cause!<br>
45
+ * This ctor is meant to be used for extension, together with a custom codec.
46
+ *
47
+ * @param failureType the failure type
48
+ * @param failureCode the failure code (e.g. 404)
49
+ * @param message the failure message
50
+ */
51
+ protected ReplyException (ReplyFailure failureType , int failureCode , String message , Throwable cause , boolean noStackTrace ) {
52
+ super (message , cause , noStackTrace );
53
+ this .failureType = failureType ;
54
+ this .failureCode = failureCode ;
55
+ }
56
+
29
57
/**
30
58
* Create a ReplyException
31
59
*
@@ -34,9 +62,7 @@ public class ReplyException extends VertxException {
34
62
* @param message the failure message
35
63
*/
36
64
public ReplyException (ReplyFailure failureType , int failureCode , String message ) {
37
- super (message );
38
- this .failureType = failureType ;
39
- this .failureCode = failureCode ;
65
+ this (failureType , failureCode , message , true );
40
66
}
41
67
42
68
/**
@@ -81,5 +107,4 @@ public String toString() {
81
107
String message = getMessage ();
82
108
return "(" + failureType + "," + failureCode + ") " + (message != null ? message : "" );
83
109
}
84
-
85
110
}
0 commit comments