updated publish error function to throw actual error received along with typical 'failed to publish' message