Disable error log when optionally using artifacts

hi,
I’m using Gitlab 15.11 on-prem with license.

We are creating job artifact for silent logs (which aren’t printed to stdout, but instead are saved in a file). This files are not always created, which makes the job logs in gitlab show an error: “ERROR: No files to upload”. Although the artifacts are not mandatory, and aren’t failing the job, the error message is still annoying, I would suggest let the user decide for if each file can be optionally added. and if it is optional, do not print ERROR, it confuses multiple dev-teams when the pipe is for all.

How can we loose that error in an “elegant” way?