Skip to content

Commit 3bb8d1a

Browse files
committed
rename set_http_context to set_request_context
1 parent 2158dee commit 3bb8d1a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Change default `included_environments` to only include `:prod` by default (#370)
1313
* Change default event send type to :none instead of :async (#341)
1414
* Make hackney an optional dependency, and simplify Sentry.HTTPClient behaviour (#400)
15-
* Use Logger.metadata for Sentry.Context, and no longer return metadata values on set_* functions
15+
* Use Logger.metadata for Sentry.Context, no longer return metadata values on set_* functions, and rename `set_http_context` to `set_request_context`
1616

1717
## 7.2.4 (2020-03-09)
1818

lib/sentry/context.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ defmodule Sentry.Context do
155155
156156
## Example
157157
158-
iex(1)> Sentry.Context.set_http_context(%{id: 123})
158+
iex(1)> Sentry.Context.set_request_context(%{id: 123})
159159
:ok
160-
iex(2)> Sentry.Context.set_http_context(%{url: "www.example.com"})
160+
iex(2)> Sentry.Context.set_request_context(%{url: "www.example.com"})
161161
:ok
162162
iex(3)> Sentry.Context.get_all()
163163
%{
@@ -168,8 +168,8 @@ defmodule Sentry.Context do
168168
user: %{}
169169
}
170170
"""
171-
@spec set_http_context(map()) :: :ok
172-
def set_http_context(map) when is_map(map) do
171+
@spec set_request_context(map()) :: :ok
172+
def set_request_context(map) when is_map(map) do
173173
set_context(@request_key, map)
174174
end
175175

test/context_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ defmodule Sentry.ContextTest do
5656
assert event.user == %{}
5757
end
5858

59-
test "storing http context appears when generating event" do
60-
Sentry.Context.set_http_context(%{"url" => "https://wow"})
59+
test "storing request context appears when generating event" do
60+
Sentry.Context.set_request_context(%{"url" => "https://wow"})
6161

6262
exception = RuntimeError.exception("error")
6363
event = Sentry.Event.transform_exception(exception, request: %{"method" => "GET"})

0 commit comments

Comments
 (0)