Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我使用 Json4s 3.2.9 native 时,每次它在 Scala 中解析错误的 JSON 时都会得到一个堆栈跟踪。我有测试,我确保正确处理无效的 JSON,现在堆栈跟踪使我的测试变得混乱-.-,我可以关闭它,还是可以更改为 json4s jackson 并关闭它?
您可以使用parseOptwhich 不打印任何内容并返回Option. 如果解析失败,则返回None.
parseOpt
Option
None