mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
address feedback re nil s
This commit is contained in:
parent
e0ad105373
commit
224888c4a3
@ -9,7 +9,11 @@ For example, to receive JSON you could do:
|
|||||||
```go
|
```go
|
||||||
nc, err := nats.Connect("demo.nats.io",
|
nc, err := nats.Connect("demo.nats.io",
|
||||||
nats.ErrorHandler(func(nc *nats.Conn, s *nats.Subscription, err error) {
|
nats.ErrorHandler(func(nc *nats.Conn, s *nats.Subscription, err error) {
|
||||||
log.Printf("Async error in %q/%q: %v", s.Subject, s.Queue, err)
|
if s != nil {
|
||||||
|
log.Printf("Async error in %q/%q: %v", s.Subject, s.Queue, err)
|
||||||
|
} else {
|
||||||
|
log.Printf("Async error outside subscription: %v", err)
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user