Skip to content

Commit

Permalink
refactor: updates to latest tower
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Oct 4, 2024
1 parent a60ebd8 commit d7af1cb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 27 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@ end

## Usage

First, `Tower` error handler must be attached.

```elixir
# lib/<your_app>/application.ex

defmodule YourApp.Application do
def start(_type, _args) do
Tower.attach()

# rest of your code
end
```

Then ask `Tower` to use the `TowerRollbar` reporter.
Ask `Tower` to use the `TowerRollbar` reporter.

```elixir
# config/config.exs
Expand Down
2 changes: 1 addition & 1 deletion blend/plug_1_14.mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"},
"tower": {:hex, :tower, "0.5.2", "8b6bbf521acf41a3f55a202fad42358f1f0b08ef933e07cb080ea3eb9ed4e54e", [:mix], [{:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}, {:uniq, "~> 0.6.0", [hex: :uniq, repo: "hexpm", optional: false]}], "hexpm", "8ddeb1163f3217255d5a500c29db1f113bcf3ed2ec80bc2b82f2a36a22e8cbe2"},
"tower": {:git, "https://github.com/mimiquate/tower.git", "fc866fca6d1c66a4cedd4f6e0f182c02009c269a", [tag: "v0.6.0"]},
"uniq": {:hex, :uniq, "0.6.1", "369660ecbc19051be526df3aa85dc393af5f61f45209bce2fa6d7adb051ae03c", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "6426c34d677054b3056947125b22e0daafd10367b85f349e24ac60f44effb916"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
}
2 changes: 1 addition & 1 deletion blend/plug_1_15.mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"},
"tower": {:hex, :tower, "0.5.2", "8b6bbf521acf41a3f55a202fad42358f1f0b08ef933e07cb080ea3eb9ed4e54e", [:mix], [{:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}, {:uniq, "~> 0.6.0", [hex: :uniq, repo: "hexpm", optional: false]}], "hexpm", "8ddeb1163f3217255d5a500c29db1f113bcf3ed2ec80bc2b82f2a36a22e8cbe2"},
"tower": {:git, "https://github.com/mimiquate/tower.git", "fc866fca6d1c66a4cedd4f6e0f182c02009c269a", [tag: "v0.6.0"]},
"uniq": {:hex, :uniq, "0.6.1", "369660ecbc19051be526df3aa85dc393af5f61f45209bce2fa6d7adb051ae03c", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "6426c34d677054b3056947125b22e0daafd10367b85f349e24ac60f44effb916"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
}
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule TowerRollbar.MixProject do
defp deps do
[
{:jason, "~> 1.4"},
{:tower, "~> 0.5.0"},
{:tower, github: "mimiquate/tower", tag: "v0.6.0"},
{:plug, "~> 1.14"},

# Only needed for Erlang < 25
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"},
"tower": {:hex, :tower, "0.5.3", "55f1c34ea2a9b057fa5386fb05fd54cdf9ef866c0bfab054716db87f32f76b94", [:mix], [{:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}, {:uniq, "~> 0.6.0", [hex: :uniq, repo: "hexpm", optional: false]}], "hexpm", "2ed7a79055315a8e222677d842894992fd7a830d96a3ea3d1985ede8e48bab7c"},
"tower": {:git, "https://github.com/mimiquate/tower.git", "fc866fca6d1c66a4cedd4f6e0f182c02009c269a", [tag: "v0.6.0"]},
"uniq": {:hex, :uniq, "0.6.1", "369660ecbc19051be526df3aa85dc393af5f61f45209bce2fa6d7adb051ae03c", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm", "6426c34d677054b3056947125b22e0daafd10367b85f349e24ac60f44effb916"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
}
12 changes: 3 additions & 9 deletions test/tower_rollbar_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ defmodule TowerRollbarTest do
Application.put_env(:tower_rollbar, :environment, :test)
Application.put_env(:tower_rollbar, :access_token, "fake-token")

Tower.attach()

on_exit(fn ->
Tower.detach()
end)

{:ok, bypass: bypass}
end

Expand Down Expand Up @@ -54,7 +48,7 @@ defmodule TowerRollbarTest do
%{
"method" => ~s(anonymous fn/0 in TowerRollbarTest."test reports arithmetic error"/1),
"filename" => "test/tower_rollbar_test.exs",
"lineno" => 70
"lineno" => 64
} = List.last(frames)
)

Expand Down Expand Up @@ -107,7 +101,7 @@ defmodule TowerRollbarTest do
%{
"method" => ~s(anonymous fn/0 in TowerRollbarTest."test reports throw"/1),
"filename" => "test/tower_rollbar_test.exs",
"lineno" => 123
"lineno" => 117
} = List.last(frames)
)

Expand Down Expand Up @@ -160,7 +154,7 @@ defmodule TowerRollbarTest do
%{
"method" => ~s(anonymous fn/0 in TowerRollbarTest."test reports abnormal exit"/1),
"filename" => "test/tower_rollbar_test.exs",
"lineno" => 176
"lineno" => 170
} = List.last(frames)
)

Expand Down

0 comments on commit d7af1cb

Please sign in to comment.