Sometimes you may be interested in an event taking place at a particular location during processing.
has_error = any(result["error"] is not None for result in context.data["results"])
print("Publishing %s" % ("failed" if has_error else "finished"))
This will cause
"Publishing failed"to be printed upon completed publishing, based on whether it completed successfully or not.