mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-05 22:55:58 +00:00
Add a now missing case to handle parse failures
This commit is contained in:
parent
2768223054
commit
283e80bc47
@ -10,6 +10,7 @@ import cats.parse.Parser.Expectation.InRange
|
|||||||
import cats.parse.Parser.Expectation.Length
|
import cats.parse.Parser.Expectation.Length
|
||||||
import cats.parse.Parser.Expectation.OneOfStr
|
import cats.parse.Parser.Expectation.OneOfStr
|
||||||
import cats.parse.Parser.Expectation.StartOfString
|
import cats.parse.Parser.Expectation.StartOfString
|
||||||
|
import cats.parse.Parser.Expectation.WithContext
|
||||||
|
|
||||||
final case class ParseFailure(
|
final case class ParseFailure(
|
||||||
input: String,
|
input: String,
|
||||||
@ -101,5 +102,8 @@ object ParseFailure {
|
|||||||
case OneOfStr(offset, strs) =>
|
case OneOfStr(offset, strs) =>
|
||||||
val options = strs.take(8)
|
val options = strs.take(8)
|
||||||
ExpectMessage(offset, options.take(7), options.size < 8)
|
ExpectMessage(offset, options.take(7), options.size < 8)
|
||||||
|
|
||||||
|
case WithContext(ctx, expect) =>
|
||||||
|
ExpectMessage(expect.offset, s"Failed to parse near: $ctx" :: Nil, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user