mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
cmoparing errors with strings now
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/iron-io/iron_go/worker"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net"
|
||||
// "net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
@@ -91,7 +91,8 @@ func ProxyFunc(w http.ResponseWriter, req *http.Request) {
|
||||
etype := reflect.TypeOf(err)
|
||||
fmt.Println("err type:", etype)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
if etype == reflect.TypeOf(net.OpError{}) { // couldn't figure out a better way to do this
|
||||
// can't figure out how to compare types so comparing strings.... lame.
|
||||
if strings.Contains(etype.String(), "net.OpError") { // == reflect.TypeOf(net.OpError{}) { // couldn't figure out a better way to do this
|
||||
fmt.Println("It's a network error, so we're going to start new task.")
|
||||
// start new worker
|
||||
payload := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user