Skip to content

Commit

Permalink
Clear up ParseFailure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
noelwelsh committed Jul 4, 2024
1 parent 9e900b1 commit 974d43e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/shared/src/main/scala/krop/route/Path.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ object Path {
val noMoreMatches =
ParseFailure(
ParseStage.Uri,
"This Path does not match any more segments in the URI",
"The URI has more segments than expected",
"""The URI this Path was matching against still contains segments. However
|this Path does not match any more segments. To match and ignore all the
|remaining segments use Segment.all. The match and capture all remaining
Expand All @@ -380,15 +380,15 @@ object Path {
def segmentMismatch(actual: String, expected: String) =
ParseFailure(
ParseStage.Uri,
"The URI segment does not match the expected segment",
"A URI segment is not the expected segment",
s"""This Path is expecting the segment ${expected}. However the URI
|contained the segment ${actual} which does not match.""".stripMargin
)

def paramMismatch(error: ParamParseFailure) =
ParseFailure(
ParseStage.Uri,
"The URI segment does not match the parameter",
"A URI segment does not match a parameter",
s"""This Path is expecting a segment to match the Param
|${error.description}. However the URI contained the segment
|${error.value} which does not match.""".stripMargin
Expand All @@ -397,7 +397,7 @@ object Path {
def queryFailure(error: QueryParseFailure) =
ParseFailure(
ParseStage.Uri,
"The URI's query parameters did contain an expected value",
"The URI's query parameters did not contain an expected value",
s"""The URI's query parameters were not successfully parsed with the
|following problem:
|
Expand Down
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/krop/tool/NotFound.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object NotFound {
s"""<li>
| <p><pre><code>${Html.quote(route.request.describe)}</code></pre></p>
| <details>
| <summary>${reason.summary}</summary>
| <summary><code>${reason.stage.toString}</code> ${reason.summary}</summary>
| <p>${reason.detail}</p>
| </details>
|</li>""".stripMargin
Expand Down

0 comments on commit 974d43e

Please sign in to comment.