是否有可能使json4s不會拋出異常,當需要的領域缺失?是否有可能讓json4s在必填字段丟失時不會拋出異常?
當從原料JSON字符串我「提取」的對象,它拋出這樣一個
org.json4s.package$MappingException: No usable value for pager
No usable value for rpp
Did not find value which can be converted into byte
at org.json4s.reflect.package$.fail(package.scala:98)
at org.json4s.Extraction$ClassInstanceBuilder.org$json4s$Extraction$ClassInstanceBuilder$$buildCtorArg(Extraction.scala:388)
at org.json4s.Extraction$ClassInstanceBuilder$$anonfun$11.apply(Extraction.scala:396)
異常是否有可能只是讓它爲空?