Skip to content

Commit

Permalink
Shorten exception/throw interception
Browse files Browse the repository at this point in the history
  • Loading branch information
aerosol committed May 22, 2024
1 parent d0d554e commit 207d59d
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions lib/plausible/verification/check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,14 @@ defmodule Plausible.Verification.Check do
@behaviour Plausible.Verification.Check

def perform_wrapped(state) do
try do
perform(state)
rescue
e ->
Logger.error(
"Error running check #{inspect(__MODULE__)} on #{state.url}: #{inspect(e)}"
)
perform(state)
catch
_, e ->
Logger.error(
"Error running check #{inspect(__MODULE__)} on #{state.url}: #{inspect(e)}"
)

put_diagnostics(state, service_error: true)
catch
e ->
Logger.error(
"Error running check #{inspect(__MODULE__)} on #{state.url}: #{inspect(e)}"
)

put_diagnostics(state, service_error: true)
end
put_diagnostics(state, service_error: true)
end
end
end
Expand Down

0 comments on commit 207d59d

Please sign in to comment.