@@ -91,13 +91,18 @@ defmodule Sentry do
9191 See `Sentry.Logger`
9292 """
9393
94- @ type task :: { :ok , Task . t } | :error | :excluded | :ignored
94+ @ type task :: { :ok , Task . t ( ) } | :error | :excluded | :ignored
9595
9696 def start ( _type , _opts ) do
9797 children = [
9898 supervisor ( Task.Supervisor , [ [ name: Sentry.TaskSupervisor ] ] ) ,
99- :hackney_pool . child_spec ( Sentry.Client . hackney_pool_name ( ) , [ timeout: Config . hackney_timeout ( ) , max_connections: Config . max_hackney_connections ( ) ] )
99+ :hackney_pool . child_spec (
100+ Sentry.Client . hackney_pool_name ( ) ,
101+ timeout: Config . hackney_timeout ( ) ,
102+ max_connections: Config . max_hackney_connections ( )
103+ )
100104 ]
105+
101106 opts = [ strategy: :one_for_one , name: Sentry.Supervisor ]
102107
103108 Supervisor . start_link ( children , opts )
@@ -107,7 +112,7 @@ defmodule Sentry do
107112 Parses and submits an exception to Sentry if current environment is in included_environments.
108113 `opts` argument is passed as the second argument to `Sentry.send_event/2`.
109114 """
110- @ spec capture_exception ( Exception . t , Keyword . t ) :: task
115+ @ spec capture_exception ( Exception . t ( ) , Keyword . t ( ) ) :: task
111116 def capture_exception ( exception , opts \\ [ ] ) do
112117 filter_module = Config . filter ( )
113118 { source , opts } = Keyword . pop ( opts , :event_source )
@@ -126,7 +131,7 @@ defmodule Sentry do
126131
127132 `opts` argument is passed as the second argument to `Sentry.send_event/2`.
128133 """
129- @ spec capture_message ( String . t , Keyword . t ) :: task
134+ @ spec capture_message ( String . t ( ) , Keyword . t ( ) ) :: task
130135 def capture_message ( message , opts \\ [ ] ) do
131136 opts
132137 |> Keyword . put ( :message , message )
@@ -139,13 +144,15 @@ defmodule Sentry do
139144
140145 `opts` argument is passed as the second argument to `send_event/2` of the configured `Sentry.HTTPClient`. See `Sentry.Client.send_event/2` for more information.
141146 """
142- @ spec send_event ( Event . t , Keyword . t ) :: task
147+ @ spec send_event ( Event . t ( ) , Keyword . t ( ) ) :: task
143148 def send_event ( event , opts \\ [ ] )
149+
144150 def send_event ( % Event { message: nil , exception: nil } , _opts ) do
145151 Logger . warn ( "Sentry: unable to parse exception" )
146152
147153 :ignored
148154 end
155+
149156 def send_event ( % Event { } = event , opts ) do
150157 included_environments = Config . included_environments ( )
151158 environment_name = Config . environment_name ( )
0 commit comments