From 283e80bc47835c0927bb47267fad696f81cd81da Mon Sep 17 00:00:00 2001
From: Eike Kettner <eike.kettner@posteo.de>
Date: Sun, 16 May 2021 22:49:20 +0200
Subject: [PATCH] Add a now missing case to handle parse failures

---
 .../shared/src/main/scala/docspell/query/ParseFailure.scala   | 4 ++++
 1 file changed, 4 insertions(+)

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)
     }
 }