Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(71)

Unified Diff: testservices/novaservice/service_http.go

Issue 97870044: Added json encoded for ServerErrors
Patch Set: Added json encoded for ServerErrors Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testservices/novaservice/service.go ('k') | testservices/novaservice/service_http_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testservices/novaservice/service_http.go
=== modified file 'testservices/novaservice/service_http.go'
--- testservices/novaservice/service_http.go 2014-01-24 16:33:31 +0000
+++ testservices/novaservice/service_http.go 2014-05-02 01:12:04 +0000
@@ -297,6 +297,7 @@
return
}
var resp http.Handler
+
if err == testservices.RateLimitExceededError {
resp = errRateLimitExceeded
} else if err == testservices.NoMoreFloatingIPs {
@@ -306,9 +307,10 @@
} else {
resp, _ = err.(http.Handler)
if resp == nil {
+ code, encodedErr := errorJSONEncode(err)
resp = &errorResponse{
- http.StatusInternalServerError,
- `{"internalServerError":{"message":"$ERROR$",code:500}}`,
+ code,
+ encodedErr,
"application/json",
err.Error(),
nil,
@@ -651,7 +653,7 @@
}
server, err := n.server(serverId)
if err != nil {
- return errNotFoundJSON
+ return err
}
if groups {
srvGroups := n.allServerSecurityGroups(serverId)
« no previous file with comments | « testservices/novaservice/service.go ('k') | testservices/novaservice/service_http_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b