improve get api error messages

This commit is contained in:
Anton Evangelatov 2021-08-16 14:33:08 +03:00
parent 6812c293b1
commit adcb8f3b15
3 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ var AuthApiInfoToken = &cli.Command{
ainfo, err := GetAPIInfo(cctx, t)
if err != nil {
return xerrors.Errorf("could not get API info: %w", err)
return xerrors.Errorf("could not get API info for %s: %w", t, err)
}
// TODO: Log in audit log when it is implemented

View File

@ -34,7 +34,7 @@ var PprofGoroutines = &cli.Command{
}
ainfo, err := GetAPIInfo(cctx, t)
if err != nil {
return xerrors.Errorf("could not get API info: %w", err)
return xerrors.Errorf("could not get API info for %s: %w", t, err)
}
addr, err := ainfo.Host()
if err != nil {

View File

@ -181,7 +181,7 @@ func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) {
func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http.Header, error) {
ainfo, err := GetAPIInfo(ctx, t)
if err != nil {
return "", nil, xerrors.Errorf("could not get API info: %w", err)
return "", nil, xerrors.Errorf("could not get API info for %s: %w", t, err)
}
addr, err := ainfo.DialArgs(version)