server: Return the path alongside the error from JobArtifactLocation

Even though the file isn't there it can be useful to have the full path
that it was checking for.

Related: RHEL-60142
This commit is contained in:
Brian C. Lane 2025-01-31 13:36:35 -08:00 committed by Sanne Raymaekers
parent d0be06278c
commit 3781820b45

View file

@ -651,7 +651,7 @@ func (s *Server) JobArtifactLocation(id uuid.UUID, name string) (string, error)
p := path.Join(s.config.ArtifactsDir, id.String(), name)
if _, err := os.Stat(p); errors.Is(err, os.ErrNotExist) {
return "", fmt.Errorf("Artifact not found: %s", p)
return p, fmt.Errorf("Artifact not found: %s", p)
}
return p, nil
}