Permalink
Browse files

Don't dump so many stacks.

  • Loading branch information...
1 parent e1abac3 commit 4439973f017394cb7a3698837e04a34bbc38e62c @dustin dustin committed Oct 19, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 vbmap.go
View
@@ -102,6 +102,11 @@ func displayMap(w http.ResponseWriter, req *http.Request, bucket *couchbase.Buck
}
func mapHandler(w http.ResponseWriter, req *http.Request) {
+ defer func() {
+ if x := recover(); x != nil {
+ log.Printf("panic: recovering from %v", x)
+ }
+ }()
bucket := getBucket(req)
if bucket == nil {
http.NotFound(w, req)
@@ -158,6 +163,11 @@ func getStats(bucket *couchbase.Bucket, commonSuffixMC string) map[string]map[st
}
func statsHandler(w http.ResponseWriter, req *http.Request) {
+ defer func() {
+ if x := recover(); x != nil {
+ log.Printf("panic: recovering from %v", x)
+ }
+ }()
bucket := getBucket(req)
if bucket == nil {
http.NotFound(w, req)
@@ -173,6 +183,12 @@ func statsHandler(w http.ResponseWriter, req *http.Request) {
}
func vbHandler(w http.ResponseWriter, req *http.Request) {
+ defer func() {
+ if x := recover(); x != nil {
+ log.Printf("panic: recovering from %v", x)
+ }
+ }()
+
bucket := getBucket(req)
defer bucket.Close()

0 comments on commit 4439973

Please sign in to comment.