Please ensure that the server you were trying to connect to has proper support for 1.8. Some modded 1.7 servers may allow 1.8 clients to connect, but may not actually support many of the core game updates. Because of this, things are prone to break and may even crash your game.
It's best to contact the server administrators and let them know of this error. For reference, you may also link back to this article for further information.
If you are a server administrator
Please ensure that your server has proper 1.8 support; not a simple protocol hack to allow legacy clients to connect. If you don't have proper 1.8 support, things are prone to break — and potentially will crash players connecting to your server.
If you are unable to provide 1.8 support, please make sure that the server is running the latest version (or builds) possible. It's also probable that one of your mods and/or plugins you are running is to blame, at which point you should ensure they all support the version/build you are running.
Please help me