Skip to content

Commit

Permalink
Treat the HTTP error message prefix as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
seh committed Sep 28, 2016
1 parent 4563c50 commit 4f48c58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type unsuccessfulHTTPResponse struct {
}

func (u *unsuccessfulHTTPResponse) Error() string {
return fmt.Sprint(u.messagePrefix, ", rcode = ", u.statusCode)
if len(u.messagePrefix) > 0 {
return fmt.Sprint(u.messagePrefix, ", rcode = ", u.statusCode)
}
return fmt.Sprint("rcode = ", u.statusCode)
}

// HTTPResponseStatusCode extracts the HTTP status code for the response from Eureka that motivated
Expand Down

0 comments on commit 4f48c58

Please sign in to comment.