opentelemetry_req: Don't assume `request.options` is a map (#192)
This commit is contained in:
parent
e2faad163c
commit
5380a94bc9
|
@ -209,15 +209,11 @@ defmodule OpentelemetryReq do
|
|||
end
|
||||
|
||||
defp require_path_params_option(request) do
|
||||
unless request.options[:no_path_params] do
|
||||
unless Map.has_key?(request.options, :path_params) do
|
||||
if !request.options[:no_path_params] and !request.options[:path_params] do
|
||||
{Req.Request.halt(request), __MODULE__.PathParamsOptionError.new()}
|
||||
else
|
||||
request
|
||||
end
|
||||
else
|
||||
request
|
||||
end
|
||||
end
|
||||
|
||||
defmodule PathParamsOptionError do
|
||||
|
@ -229,7 +225,7 @@ defmodule OpentelemetryReq do
|
|||
|
||||
@impl true
|
||||
def message(_) do
|
||||
"req_path_params path parameter options must be provided"
|
||||
":path_params option must be set"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue