Skip to content

Commit bfec32c

Browse files
committed
♻️! using IllegalStateException instead of NotSerializableException
1 parent 0101aad commit bfec32c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/main/java/com/mindee/parsing/common/ErrorDetails.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.mindee.parsing.common;
22

3-
43
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
54
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
65
import lombok.Getter;

src/main/java/com/mindee/parsing/common/ErrorDetailsDeserializer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
77

88
import java.io.IOException;
9-
import java.io.NotSerializableException;
109

1110
public class ErrorDetailsDeserializer extends StdDeserializer<ErrorDetails> {
1211

@@ -31,7 +30,7 @@ public ErrorDetails deserialize(JsonParser jsonParser,
3130
} else if (node.isTextual()) {
3231
details = node.textValue();
3332
} else {
34-
throw new NotSerializableException();
33+
throw new IllegalStateException("The JSON type is not handled.");
3534
}
3635

3736
return new ErrorDetails(details);

0 commit comments

Comments
 (0)