Improved exception logged in headers when message is sent to error queue. Fixes #860