Improve error message handling when submitting bugs