...
1
2 package sentryhandler_test
3
4 import (
5 "github.com/getsentry/raven-go"
6
7 "github.com/goph/emperror/handler/sentryhandler"
8 )
9
10 func ExampleNew() {
11 dsn := "https://user:password@sentry.io/1234"
12
13 handler, err := sentryhandler.New(dsn)
14 if err != nil {
15 panic(err)
16 }
17 defer handler.Close()
18
19
20 }
21
22 func ExampleNewFromClient() {
23 dsn := "https://user:password@sentry.io/1234"
24
25 client, err := raven.New(dsn)
26 if err != nil {
27 panic(err)
28 }
29
30 handler := sentryhandler.NewFromClient(client)
31 defer handler.Close()
32
33
34 }
35
36 func ExampleNewSync() {
37 dsn := "https://user:password@sentry.io/1234"
38
39 handler, err := sentryhandler.NewSync(dsn)
40 if err != nil {
41 panic(err)
42 }
43 defer handler.Close()
44
45
46 }
47
48 func ExampleNewSyncFromClient() {
49 dsn := "https://user:password@sentry.io/1234"
50
51 client, err := raven.New(dsn)
52 if err != nil {
53 panic(err)
54 }
55
56 handler := sentryhandler.NewSyncFromClient(client)
57 defer handler.Close()
58
59
60 }
61
View as plain text