Add example for InvalidAuthEvent
Norberto Lopes
8 years ago
12 | 12 | rtm := api.NewRTM() |
13 | 13 | go rtm.ManageConnection() |
14 | 14 | |
15 | Loop: | |
15 | 16 | for { |
16 | 17 | select { |
17 | 18 | case msg := <-rtm.IncomingEvents: |
38 | 39 | case *slack.RTMError: |
39 | 40 | fmt.Printf("Error: %s\n", ev.Error()) |
40 | 41 | |
42 | case *slack.InvalidAuthEvent: | |
43 | fmt.Printf("Invalid credentials") | |
44 | break Loop | |
45 | ||
41 | 46 | default: |
47 | ||
42 | 48 | // Ignore other events.. |
43 | //fmt.Printf("Unexpected: %v\n", msg.Data) | |
49 | // fmt.Printf("Unexpected: %v\n", msg.Data) | |
44 | 50 | } |
45 | 51 | } |
46 | 52 | } |