Log: improve error logging

When pushing an image to Distribution server with Notary enabled at the
first time, client will try to get the root.json and it will fail since
there is nothing in Notary yet.

This patch enhances the error message by adding the error detail.
- "404 GET notary-distribution:5678/busybox:root"

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
HuKeping 2016-01-11 15:01:55 +08:00
parent 3fa73e80b9
commit 5968823ace
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ func getHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, var
out, err := store.GetCurrent(gun, tufRole)
if err != nil {
if _, ok := err.(storage.ErrNotFound); ok {
logrus.Error("404 GET " + gun + ":" + tufRole)
logrus.Errorf("404 GET %s:%s, error: %v", gun, tufRole, err)
return errors.ErrMetadataNotFound.WithDetail(nil)
}
logger.Error("500 GET")