frostfs-s3-gw/api/handler/info.go
Denis Kirillov f4c29cd300 [#184] Unify error handling
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2021-08-05 12:18:52 +03:00

20 lines
510 B
Go

package handler
import (
"net/http"
"github.com/nspcc-dev/neofs-s3-gw/api"
)
func (h *handler) GetBucketLocationHandler(w http.ResponseWriter, r *http.Request) {
reqInfo := api.GetReqInfo(r.Context())
if _, err := h.obj.GetBucketInfo(r.Context(), reqInfo.BucketName); err != nil {
h.logAndSendError(w, "something went wrong", reqInfo, err)
return
}
if err := api.EncodeToResponse(w, LocationResponse{Location: ""}); err != nil {
h.logAndSendError(w, "something went wrong", reqInfo, err)
}
}