Skip to content

Commit

Permalink
Throw a better exception (instead of logging an error and throwing a …
Browse files Browse the repository at this point in the history
…less informative exception) (#26)
  • Loading branch information
DilumAluthge authored Jul 15, 2021
1 parent 6c26f7b commit fc95e1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SMARTAppLaunch"
uuid = "d2818e16-7729-416e-a683-becc19f3d01b"
authors = ["Dilum Aluthge", "contributors"]
version = "1.1.1"
version = "1.1.2"

[deps]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Expand Down
14 changes: 8 additions & 6 deletions src/provider/ehr_launch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ function provider_ehr_launch(config::ProviderEHRLaunchConfig;
redirect = false,
)
headers = Dict(authorize_response.headers)
auth_error_msg = string(
"Something when wrong when authenticating to the EHR. ",
"One possible explanation is that your `redirect_uri` value does not exactly ",
"match any of the `redirect_uri` values that are on file with the EHR.",
)
haskey(headers, "Location") || @error(auth_error_msg)
let
auth_error_msg = string(
"Something when wrong when authenticating to the EHR. ",
"One possible explanation is that your `redirect_uri` value does not exactly ",
"match any of the `redirect_uri` values that are on file with the EHR.",
)
haskey(headers, "Location") || throw(ErrorException(auth_error_msg))
end
location = headers["Location"]
location_uri = URIs.URI(location)
location_queryparams = URIs.queryparams(location_uri)
Expand Down

2 comments on commit fc95e1b

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/40918

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.2 -m "<description of version>" fc95e1b4b714eac1d7171a8056c40494ccd82c04
git push origin v1.1.2

Please sign in to comment.