Skip to content
This repository has been archived by the owner on Nov 18, 2017. It is now read-only.

Commit

Permalink
Allow no errors in querying member when it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Deare committed Sep 29, 2016
1 parent 49ffc42 commit c340122
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/fsm_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ func singleFSMMemberHandler(singleFSM fsm.SingleLeaderFSM, singleService service
log.Error("Error sending error response")
}
}
member, err := singleService.FSMMemberFromBytes(memberData)
if err != nil {
if err := sendResponse(500, nil, []error{err}, w); err != nil {
log.Error("Error sending error response")
var member fsm.Member
if exists {
member, err = singleService.FSMMemberFromBytes(memberData)
if err != nil {
if err := sendResponse(500, nil, []error{err}, w); err != nil {
log.Error("Error sending error response")
}
}
}
if err := sendResponse(200, memberAPIResp{Member: member, Exists: exists}, []error{}, w); err != nil {
Expand Down

0 comments on commit c340122

Please sign in to comment.