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 0bb39d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 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
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 0bb39d7

Please sign in to comment.