Skip to content

Commit

Permalink
feat: log JSON string when failing to parse it
Browse files Browse the repository at this point in the history
  • Loading branch information
MangelMaxime committed Feb 10, 2025
1 parent 0f4b080 commit cb9536f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8

* text=auto eol=lf
2 changes: 1 addition & 1 deletion build/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"type": "Direct",
"requested": "[8.0.200, )",
"resolved": "8.0.200",
"contentHash": "U016Y0NhtIEQvbmxf6Sff9lx7PTSGEFctA/kLrJr9MvNfKwjrzlK/4C2V1StgsapegWeGYW6K8Zd/D6vc9C4Yw=="
"contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ=="
},
"Semver": {
"type": "Direct",
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.204",
"rollForward": "latestPatch"
"rollForward": "latestMinor"
}
}
8 changes: 7 additions & 1 deletion src/Git.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ let readCommit (sha1: string) =

match Decode.fromString Commit.Decoder commitStdout with
| Ok x -> x
| Error e -> failwith e
| Error e ->
$"""Failed to parse JSON:
{commitStdout}
Error: {e}"""
|> failwith

let getCommits (filter: GetCommitsFilter) =
let commitFilter =
Expand Down

0 comments on commit cb9536f

Please sign in to comment.