Skip to content

Commit

Permalink
Merge pull request #421 from supermario/improve-frontmatter-errors
Browse files Browse the repository at this point in the history
Improve frontmatter failures by displaying the filepath being processed
  • Loading branch information
dillonkearns authored Sep 24, 2023
2 parents aa02382 + 415095f commit 86fe340
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BackendTask/File.elm
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ bodyWithFrontmatter frontmatterDecoder filePath =
{ title = "BackendTask.File Decoder Error"
, body =
"I encountered a Json Decoder error from a call to BackendTask.File.bodyWithFrontmatter.\n\n"
++ ("I was trying to process `" ++ filePath ++ "`.\n\n")
++ Decode.errorToString frontmatterDecodeError
}
|> FatalError.build
Expand Down Expand Up @@ -257,6 +258,7 @@ onlyFrontmatter frontmatterDecoder filePath =
{ title = "BackendTask.File Decoder Error"
, body =
"I encountered a Json Decoder error from a call to BackendTask.File.onlyFrontmatter.\n\n"
++ ("I was trying to process `" ++ filePath ++ "`.\n\n")
++ Decode.errorToString frontmatterDecodeError
}
|> FatalError.build
Expand Down

0 comments on commit 86fe340

Please sign in to comment.