Rub*_*bic 4 string debugging scala
我在Scala中有一个解析器程序发送string到它并打破字符串和解析.我得到以下错误,我甚至不知道该程序的哪个部分是错误的:
Exception in thread "main" scala.MatchError: xxxx/xml/test3D.xml (of class java.lang.String)
Run Code Online (Sandbox Code Playgroud)
我需要检查哪些可能性以及解决这类错误的最佳方法是什么?
ka4*_*eli 10
有异常发生的确切的地方,在这个文件中用文件名和行号说明.例如,查看此堆栈跟踪:
Exception in thread "main" scala.MatchError: 7 (of class java.lang.Integer)
at stackoverflow.M$.delayedEndpoint$stackoverflow$M$1(Functions.scala:35)
at stackoverflow.M$delayedInit$body.apply(Functions.scala:30)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
Run Code Online (Sandbox Code Playgroud)
在这里,您可以看到异常原因在Functions.scala文件的第35行.堆栈跟踪中的第二行是抛出异常的行.检查这一行!
只要对象与模式匹配表达式的任何模式都不匹配,就会发生MatchError.
| 归档时间: |
|
| 查看次数: |
12068 次 |
| 最近记录: |