-
Notifications
You must be signed in to change notification settings - Fork 223
/
main.go
41 lines (34 loc) · 852 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"fmt"
"runtime/debug"
"time"
"github.com/getsentry/sentry-go"
"github.com/logrusorgru/aurora"
"github.com/superfly/flyctl/cmd"
"github.com/superfly/flyctl/flyctl"
)
func main() {
opts := sentry.ClientOptions{
Dsn: "https://89fa584dc19b47a6952dd94bf72dbab4@sentry.io/4492967",
// Debug: true,
Environment: flyctl.Environment,
Release: flyctl.Version,
}
if err := sentry.Init(opts); err != nil {
fmt.Printf("sentry.Init: %s", err)
}
defer sentry.Flush(2 * time.Second)
defer func() {
if err := recover(); err != nil {
sentry.CurrentHub().Recover(err)
fmt.Println(aurora.Red("Oops, something went wrong! Could you try that again?"))
if flyctl.Environment != "production" {
fmt.Println()
fmt.Println(err)
fmt.Println(string(debug.Stack()))
}
}
}()
cmd.Execute()
}