Assent.Strategy.request can return RequestError{error: :unreachable} in OIDC.fetch_openid_configuration/1.
Passing an existing %RequestError{} struct into RequestError.invalid/1 causes a KeyError accessing the :status field.
The changes in this PR pattern match to handle %RequestError{} and return it.
The stacktrace:
** (KeyError) key :status not found in:
%Assent.RequestError{
error: :unreachable,
message: "Server was unreachable with MyAppWeb.HTTPAdapater.\n\nFailed with the following error:\n\"socket closed\"\n\nURL: https://****/.well-known/openid-configuration\n"
}
Assent.Strategy.request
can returnRequestError{error: :unreachable}
inOIDC.fetch_openid_configuration/1
.Passing an existing
%RequestError{}
struct intoRequestError.invalid/1
causes aKeyError
accessing the:status
field.The changes in this PR pattern match to handle
%RequestError{}
and return it.The stacktrace: