diff --git a/modules/query/shared/src/main/scala/docspell/query/ParseFailure.scala b/modules/query/shared/src/main/scala/docspell/query/ParseFailure.scala index 128a08c4..2ecb1edf 100644 --- a/modules/query/shared/src/main/scala/docspell/query/ParseFailure.scala +++ b/modules/query/shared/src/main/scala/docspell/query/ParseFailure.scala @@ -10,6 +10,7 @@ import cats.parse.Parser.Expectation.InRange import cats.parse.Parser.Expectation.Length import cats.parse.Parser.Expectation.OneOfStr import cats.parse.Parser.Expectation.StartOfString +import cats.parse.Parser.Expectation.WithContext final case class ParseFailure( input: String, @@ -101,5 +102,8 @@ object ParseFailure { case OneOfStr(offset, strs) => val options = strs.take(8) ExpectMessage(offset, options.take(7), options.size < 8) + + case WithContext(ctx, expect) => + ExpectMessage(expect.offset, s"Failed to parse near: $ctx" :: Nil, true) } } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index fce0a6ed..78f427e5 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -9,7 +9,7 @@ object Dependencies { val BetterMonadicForVersion = "0.3.1" val BitpeaceVersion = "0.8.0" val CalevVersion = "0.4.3" - val CatsParseVersion = "0.3.2" + val CatsParseVersion = "0.3.4" val CirceVersion = "0.13.0" val ClipboardJsVersion = "2.0.6" val DoobieVersion = "0.13.2"