Adding better error support to api

This commit is contained in:
Frederick F. Kautz IV
2015-04-03 18:06:30 -07:00
parent a29990e4bc
commit 5865295f5d
5 changed files with 79 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ import (
"net/http"
"github.com/gorilla/mux"
"github.com/minio-io/iodine"
"github.com/minio-io/minio/pkg/drivers"
"github.com/minio-io/minio/pkg/utils/log"
)
@@ -69,10 +70,6 @@ func (server *minioAPI) listObjectsHandler(w http.ResponseWriter, req *http.Requ
{
writeErrorResponse(w, req, NoSuchBucket, acceptsContentType, req.URL.Path)
}
case drivers.ImplementationError:
{
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path)
}
case drivers.BucketNameInvalid:
{
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path)
@@ -83,7 +80,7 @@ func (server *minioAPI) listObjectsHandler(w http.ResponseWriter, req *http.Requ
}
default:
{
log.Error.Println(err)
log.Error.Println(iodine.New(err, nil))
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path)
}
}