Exit gracefully on error for publish()