render_api_error! doesn't log error message to api_json.log
This probably cost me a few hours of time this week in gitlab-com/gl-infra/production#1944 (closed) and https://gitlab.com/gitlab-org/gitlab/-/issues/214867. When we call render_api_error! (e.g. https://gitlab.com/gitlab-org/gitlab/blob/fa02fab8e289c7480dbc402c73d33a5079ae393f/lib/api/runner.rb#L283), the error message never gets sent to api_json.log, so exceptions swallowed in CreateJobArtifactsService in https://gitlab.com/gitlab-org/gitlab/blob/5817cc01107119ed203bea718468d7096ce5b02c/app/services/ci/create_job_artifacts_service.rb#L79-80 only get shown to the client.
The easiest way to handle this may be to store some environment variable and log it, similar to https://gitlab.com/gitlab-org/gitlab/blob/b8d3e417e6b2d88e769bbc165277d699be339e12/lib/gitlab/grape_logging/loggers/exception_logger.rb.