Slight improvements to exitWithError()

* Allow empty error message - will default to the title
* Respect the protocol of the server