Skip to content

Commit

Permalink
Merge branch 'master' into fix/nil-pointer-while-receive-delete-q
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Cante authored Sep 26, 2019
2 parents 8a82883 + cfaba87 commit cf42a75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ type ResponseMetadata struct {

/*** Error Responses ***/
type ErrorResult struct {
Type string `xml:"Type,omitempty"`
Code string `xml:"Code,omitempty"`
Message string `xml:"Message,omitempty"`
RequestId string `xml:"RequestId,omitempty"`
Type string `xml:"Type,omitempty"`
Code string `xml:"Code,omitempty"`
Message string `xml:"Message,omitempty"`
}

type ErrorResponse struct {
Result ErrorResult `xml:"Error"`
Result ErrorResult `xml:"Error"`
RequestId string `xml:"RequestId"`
}
5 changes: 4 additions & 1 deletion app/gosns/gosns.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,10 @@ func extractMessageFromJSON(msg string, protocol string) (string, error) {

func createErrorResponse(w http.ResponseWriter, req *http.Request, err string) {
er := app.SnsErrors[err]
respStruct := app.ErrorResponse{app.ErrorResult{Type: er.Type, Code: er.Code, Message: er.Message, RequestId: "00000000-0000-0000-0000-000000000000"}}
respStruct := app.ErrorResponse{
Result: app.ErrorResult{Type: er.Type, Code: er.Code, Message: er.Message},
RequestId: "00000000-0000-0000-0000-000000000000",
}

w.WriteHeader(er.HttpError)
enc := xml.NewEncoder(w)
Expand Down
5 changes: 4 additions & 1 deletion app/gosqs/gosqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,10 @@ func getQueueFromPath(formVal string, theUrl string) string {

func createErrorResponse(w http.ResponseWriter, req *http.Request, err string) {
er := app.SqsErrors[err]
respStruct := app.ErrorResponse{app.ErrorResult{Type: er.Type, Code: er.Code, Message: er.Message, RequestId: "00000000-0000-0000-0000-000000000000"}}
respStruct := app.ErrorResponse{
Result: app.ErrorResult{Type: er.Type, Code: er.Code, Message: er.Message},
RequestId: "00000000-0000-0000-0000-000000000000",
}

w.WriteHeader(er.HttpError)
enc := xml.NewEncoder(w)
Expand Down

0 comments on commit cf42a75

Please sign in to comment.