File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
11
11
"github.com/pkg/browser"
12
12
"golang.org/x/exp/slog"
13
+ "github.com/getsentry/sentry-go"
13
14
14
15
"github.com/apoxy-dev/apoxy-cli/rest"
15
16
"github.com/apoxy-dev/apoxy-cli/web"
@@ -103,6 +104,7 @@ func (a *Authenticator) launchServer() int {
103
104
}()
104
105
if err := a .awaitHealthy (port ); err != nil {
105
106
slog .Error (fmt .Sprintf ("Error starting server: %v" , err ))
107
+ sentry .CaptureMessage ("auth redirect server failed to start" )
106
108
}
107
109
return port
108
110
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ require (
28
28
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
29
29
github.com/davecgh/go-spew v1.1.1 // indirect
30
30
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
31
+ github.com/getsentry/sentry-go v0.26.0 // indirect
31
32
github.com/go-logr/logr v1.2.4 // indirect
32
33
github.com/go-openapi/jsonpointer v0.19.6 // indirect
33
34
github.com/go-openapi/jsonreference v0.20.2 // indirect
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBd
43
43
github.com/felixge/httpsnoop v1.0.3 /go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U =
44
44
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY =
45
45
github.com/fsnotify/fsnotify v1.6.0 /go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw =
46
+ github.com/getsentry/sentry-go v0.26.0 h1:IX3++sF6/4B5JcevhdZfdKIHfyvMmAq/UnqcyT2H6mA =
47
+ github.com/getsentry/sentry-go v0.26.0 /go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY =
46
48
github.com/go-logr/logr v1.2.0 /go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A =
47
49
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ =
48
50
github.com/go-logr/logr v1.2.4 /go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A =
Original file line number Diff line number Diff line change @@ -15,8 +15,32 @@ limitations under the License.
15
15
*/
16
16
package main
17
17
18
- import "github.com/apoxy-dev/apoxy-cli/cmd"
18
+ import (
19
+ "log"
20
+ "time"
21
+
22
+ "github.com/getsentry/sentry-go"
23
+
24
+ "github.com/apoxy-dev/apoxy-cli/cmd"
25
+ )
19
26
20
27
func main () {
28
+ // We send errors to Sentry to ensure the best possible experience for our users.
29
+ err := sentry .Init (sentry.ClientOptions {
30
+ Dsn : "https://4da486e8bfc297ebd07dea8a1419f5da@o4506619284815872.ingest.sentry.io/4506619287306240" ,
31
+ TracesSampleRate : 1.0 ,
32
+ })
33
+ if err != nil {
34
+ log .Fatalf ("sentry.Init: %s" , err )
35
+ }
36
+ defer func () {
37
+ if err := recover (); err != nil {
38
+ sentry .CurrentHub ().Recover (err )
39
+ sentry .Flush (5 * time .Second )
40
+ log .Printf ("panic: %v" , err )
41
+ }
42
+ }()
43
+ defer sentry .Flush (5 * time .Second )
44
+
21
45
cmd .Execute ()
22
46
}
You can’t perform that action at this time.
0 commit comments