async function awaitArtifacts(artifactState) {
  /** @type {IntermediateArtifacts} */
  const artifacts = {};

  for (const [id, promise] of Object.entries(artifactState.getArtifact)) {
    const artifact = await promise.catch(err => err);
    if (artifact !== undefined) artifacts[id] = artifact;
  }

  return artifacts;
}
Awaits the result of artifact, catching errors to set the artifact to an error instead.

@param {ArtifactState} artifactState
@return {Promise<Partial<LH.GathererArtifacts>>}