Skip to content

Commit

Permalink
opentelemetry_req: Don't assume request.options is a map (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Aug 18, 2023
1 parent e2faad1 commit 5380a94
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions instrumentation/opentelemetry_req/lib/opentelemetry_req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ 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
{Req.Request.halt(request), __MODULE__.PathParamsOptionError.new()}
else
request
end
if !request.options[:no_path_params] and !request.options[:path_params] do
{Req.Request.halt(request), __MODULE__.PathParamsOptionError.new()}
else
request
end
Expand All @@ -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

0 comments on commit 5380a94

Please sign in to comment.