Skip to content

Commit 43b7783

Browse files
committed
Fix Dialyzer issues
1 parent 48cf37d commit 43b7783

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/sentry/config.ex

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ defmodule Sentry.Config do
3333
def validate_included_environments! do
3434
normalized_environments =
3535
case included_environments() do
36-
comma_separated_envs when is_binary(comma_separated_envs) ->
37-
IO.warn("""
38-
setting :included_environments to a comma-separated string is deprecated and won't \
39-
be supported in the next major version. Set :included_environments to a list of \
40-
atoms instead.\
41-
""")
42-
43-
String.split(comma_separated_envs, ",")
44-
4536
list when is_list(list) ->
4637
Enum.map(list, fn
4738
env when is_atom(env) or is_binary(env) ->
@@ -114,6 +105,12 @@ defmodule Sentry.Config do
114105
{:ok, :all} ->
115106
:all
116107

108+
{:ok, envs} when is_binary(envs) ->
109+
raise ArgumentError, """
110+
setting :included_environments to a comma-separated string is not supported anymore. \
111+
Set :included_environments to a list of atoms instead.\
112+
"""
113+
117114
{:ok, envs} when is_list(envs) ->
118115
string_envs = Enum.map(envs, &to_string/1)
119116
Application.put_env(:sentry, :included_environments, string_envs)

test/config_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ defmodule Sentry.ConfigTest do
5959
test "raises if not set" do
6060
assert_raise RuntimeError, ~r/:environment_name must be set/, fn ->
6161
modify_env(:sentry, environment_name: nil)
62+
modify_system_env(%{"SENTRY_ENVIRONMENT" => nil})
6263
Config.environment_name()
6364
end
6465
end

0 commit comments

Comments
 (0)