u***@gmail.com
2015-07-30 17:11:54 UTC
I have an API service build with http lib. I have a recover inside http
handler:
132 func execApiMethod(w http.ResponseWriter, r *http.Request) {
panic: runtime error: invalid memory address or nil pointer dereference
P.S.: inside my http handler method my app makes request to https:// URLs.
Lot of them. I think, thats why I see errors in tls. I think these errors
caused by network issues.
handler:
132 func execApiMethod(w http.ResponseWriter, r *http.Request) {
133 defer func() {
134 if r := recover(); r != nil {
135 server.Logger.Print("Error: ", r)
136 }
137 }()
138
139 // doing some dirty stuf
But my app is crashing time after time with trace:134 if r := recover(); r != nil {
135 server.Logger.Print("Error: ", r)
136 }
137 }()
138
139 // doing some dirty stuf
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x58 pc=0x56053d]
crypto/tls.(*Conn).writeRecord(0xc20832fb80, 0xc2082da516, 0xc2082da510,
0x8b, 0x8b, 0x0, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/conn.go:748 +0x4ed
crypto/tls.(*Conn).clientHandshake(0xc20832fb80, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/handshake_client.go:139
+0x10f9
crypto/tls.(*Conn).Handshake(0xc20832fb80, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/conn.go:977 +0xf1
net/http.func·022()
/home/r_wilco/.gvm/gos/go1.4.2/src/net/http/transport.go:637 +0x3c
created by net/http.(*Transport).dialConn
/home/r_wilco/.gvm/gos/go1.4.2/src/net/http/transport.go:642 +0x88c
Is it possible to catch ALL panics?crypto/tls.(*Conn).writeRecord(0xc20832fb80, 0xc2082da516, 0xc2082da510,
0x8b, 0x8b, 0x0, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/conn.go:748 +0x4ed
crypto/tls.(*Conn).clientHandshake(0xc20832fb80, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/handshake_client.go:139
+0x10f9
crypto/tls.(*Conn).Handshake(0xc20832fb80, 0x0, 0x0)
/home/r_wilco/.gvm/gos/go1.4.2/src/crypto/tls/conn.go:977 +0xf1
net/http.func·022()
/home/r_wilco/.gvm/gos/go1.4.2/src/net/http/transport.go:637 +0x3c
created by net/http.(*Transport).dialConn
/home/r_wilco/.gvm/gos/go1.4.2/src/net/http/transport.go:642 +0x88c
P.S.: inside my http handler method my app makes request to https:// URLs.
Lot of them. I think, thats why I see errors in tls. I think these errors
caused by network issues.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.