Skip to content

Commit

Permalink
Fix a bug, and improve an error message (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Jul 13, 2021
1 parent 29c63cd commit 6c26f7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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.0"
version = "1.1.1"

[deps]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Expand Down
8 changes: 7 additions & 1 deletion src/provider/ehr_launch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
"""
function provider_ehr_launch(config::ProviderEHRLaunchConfig,
uri::URIs.URI;
scope::AbstractString = _default_scope)
kwargs...)
queryparams = URIs.queryparams(uri)::Dict{String, String}
return provider_ehr_launch(config, queryparams; kwargs...)
end
Expand Down Expand Up @@ -84,6 +84,12 @@ 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)

This comment has been minimized.

Copy link
@andreasnoack

andreasnoack Jul 14, 2021

Member

Why not make this throw the exception instead of just logging the error? An exception will still be thrown below because of the missing key.

This comment has been minimized.

Copy link
@DilumAluthge

DilumAluthge Jul 15, 2021

Author Member

Makes sense to me. #26

location = headers["Location"]
location_uri = URIs.URI(location)
location_queryparams = URIs.queryparams(location_uri)
Expand Down

2 comments on commit 6c26f7b

@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/40817

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.1 -m "<description of version>" 6c26f7b2cc3061ddb09ce2fc5d58808528260e88
git push origin v1.1.1

Please sign in to comment.