-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log the parsed (and pretty-printed) response body at `LogLevel(-1_000…
…`) (#132) * Log the parsed (and pretty-printed) response body at `LogLevel(-3_000`) Co-authored-by: DilumAluthge <DilumAluthge@users.noreply.github.com> * Log at `LogLevel(-1_000)` (#155) * Add tests for #132 (#156) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> --------- Co-authored-by: DilumAluthge <DilumAluthge@users.noreply.github.com> Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
- Loading branch information
1 parent
50a48bf
commit 4e56870
Showing
7 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function tryparse_json(response_body::AbstractString) | ||
response_json = try | ||
JSON3.read(response_body) | ||
catch ex | ||
# If no exception is thrown, we don't need to log `response_body`. | ||
# | ||
# However, if an exception is thrown, we need to log the entire raw | ||
# `response_body` so that the user can try to figure out why it failed to | ||
# parse as valid JSON. | ||
bt = catch_backtrace() | ||
@logmsg LogLevel(-1_000) "FHIRClient.tryparse_json()" response_body exception = | ||
(ex, bt) | ||
nothing | ||
end | ||
return response_json | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters