Thank you all for the replies.
> If I understand your problem correctly, IllegalArgumentException would be the most appropriate choice because null is a valid response from readValue.
In edge cases, the return value of readValue may not be valid.
Since ObjectMapper can be inherited, it is possible that null will be returned due to an implementation error.
It is even possible that an invalid value is returned.
Personally, I feel that IllegalArgumentException may not be the way to go in such cases.
> Or consider InvalidNullException?
I initially thought this would be better, but had the above concerns.
Would the more abstract JsonMappingException be more appropriate?
2025年3月22日土曜日 11:32:12 UTC+9 Joo Hyuk Kim: