Closed LauraBeatris closed 7 months ago
Hey @LauraBeatris, as far as I can tell, https://github.com/elixir-tesla/tesla/blob/master/lib/tesla/middleware/base_url.ex doesn't do anything special other than adding the base URL.
I will assume that :no_scheme
comes from the underlying HTTP client that you are using.
It would be helpful to confirm this.
So, I am not sure if Tesla should do much in that regard.
Potential improvement, not an actual bug:
Nowadays, if an invalid URL is provided to
plug Tesla.Middleware.BaseUrl
, then the following error is returned::no_scheme
If the URL gets incorrectly formatted by mistake, it's not explicit that's the actual reason for the error. IMO the DX would be better here if the error was more specific, such as
:invalid_url
ormissing_url_protocol
.