Skip to content
Browse files
better error message when server returns an error
we need better error handling; this solves the thing I was wondering, which is where
was the exception coming from.
  • Loading branch information
ahgittin committed Apr 24, 2017
1 parent 8f17880 commit 2094e8295edbb4c8791dece188db44c3417a533a
Showing 1 changed file with 2 additions and 1 deletion.
@@ -21,6 +21,7 @@ package error_handler
import (

@@ -32,7 +33,7 @@ func ErrorExit(errorvalue interface{}, errorcode {
switch errorvalue.(type) {
case net.HttpError:
httpError := errorvalue.(net.HttpError)
fmt.Fprintln(os.Stderr, httpError.Body)
fmt.Fprintln(os.Stderr, "Server error ("+strconv.Itoa(httpError.Code)+"): "+httpError.Body)
case error:
fmt.Fprintln(os.Stderr, errorvalue)
case string:

0 comments on commit 2094e82

Please sign in to comment.