File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
services-api/src/main/java/io/scalecube/services/api Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ public final class ServiceMessage {
2828 /** Error type header. */
2929 public static final String HEADER_ERROR_TYPE = "errorType" ;
3030
31+ /** Null value for error type. */
32+ public static final int NULL_ERROR_TYPE = -1 ;
33+
3134 private final Map <String , String > headers ;
3235 private Object data ;
3336
@@ -170,12 +173,12 @@ public boolean isError() {
170173 /**
171174 * Returns error type. Error type is an identifier of a group of errors.
172175 *
173- * @return error type.
176+ * @return error type if set otherwise {@value NULL_ERROR_TYPE} .
174177 */
175178 public int errorType () {
176179 String errorType = headers .get (HEADER_ERROR_TYPE );
177180 if (errorType == null ) {
178- return - 1 ;
181+ return NULL_ERROR_TYPE ;
179182 }
180183 try {
181184 return Integer .parseInt (errorType );
You can’t perform that action at this time.
0 commit comments