Skip to content

Commit

Permalink
better error messages from OCM /share endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Nov 29, 2022
1 parent 355791a commit 1178dc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/http/services/ocmd/shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ func (h *sharesHandler) createShare(w http.ResponseWriter, r *http.Request) {
}

if resource == "" || providerID == "" || owner == "" {
WriteError(w, r, APIErrorInvalidParameter, "missing details about resource to be shared", nil)
msg := fmt.Sprintf("missing details about resource to be shared (resource='%s', providerID='%s', owner='%s", resource, providerID, owner)
WriteError(w, r, APIErrorInvalidParameter, msg, nil)
return
}
if shareWith == "" || protocol["name"] == "" || meshProvider == "" {
WriteError(w, r, APIErrorInvalidParameter, "missing request parameters", nil)
msg := fmt.Sprintf("missing request parameters (shareWith='%s', protocol.name='%s', meshProvider='%s'", shareWith, protocol["name"], meshProvider)
WriteError(w, r, APIErrorInvalidParameter, msg, nil)
return
}

Expand Down

0 comments on commit 1178dc7

Please sign in to comment.