Raise an exception when publishing fails

We were previously just logging a message. Being unable to publish is pretty bad, and we should definitely know about it.