You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "shanedell (via GitHub)" <gi...@apache.org> on 2023/06/15 18:06:51 UTC
[GitHub] [daffodil-vscode] shanedell commented on a diff in pull request #663: Throw parse errors
shanedell commented on code in PR #663:
URL: https://github.com/apache/daffodil-vscode/pull/663#discussion_r1231376733
##########
server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala:
##########
@@ -97,12 +100,22 @@ object Parse {
val parse =
IO.interruptibleMany {
- dp.parse(
+ val parse_res = dp.parse(
new InputSourceDataInputStream(data),
infosetOutputter
- ) // WARNING: parse doesn't close the OutputStream, so closed below
- }.guaranteeCase(outcome => Logger[IO].debug(s"parse finished: $outcome"))
- .void
+ )
+
+ parse_res.isError match {
+ case true =>
+ throw new Error(
+ parse_res.getDiagnostics
+ .map(d => d.toString)
+ .mkString
Review Comment:
Yeah I believe I can do `.mkString("\n")`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org