Taken from this post on the Yogscast forums, here are some, but probably not all, of the error codes found when connecting to servers.
An error that only happens when you're playing on, logging onto/out of a server.
Connection refused: connect
There is no server online on the IP:port you put in.
You are not whitelisted on this server
You are not whitelisted on the server in question.
User Not Premium
"Free" aka cracked Minecraft clients do not pass the minecraft.net authentication, if you want to play on the servers you have to buy the game.
java.io.IOException: Server returned HTTP response code: 503
Server cannot confirm who you are with minecraft.net because minecraft.net is down, try again later.
Failed to login: Bad Login
Logging in too quickly after last attempt. This may also apply to when a non-vanilla client attempts to connect to a vanilla server (or vice versa), but in this case generally indicates version number discrepancies.
This may also occur with unequal vanilla version numbers, though this has almost been entirely replaced with the
Outdated Server or
Outdated Client error messages.
End of stream
Server has stopped sending information back to the client.
Took to long to log in
minecraft.net wasn't responding so the server cannot authenticate you.
If you use a pre-release version or a version that has just been released, servers are unlikely to support it until plugins have been updated for it.
java.net.SocketException: Connection reset
Either the server has shut down or is doing something very intensive, try logging in again later. This also occurs when the user's internet connection dies or something in between the user and the server gets disconnected. It is basically a very broad and common TCP/IP error. It means that something has happened to disconnect the connection in an abrupt and unexpected way.
You're connecting to a server on a newer version than the minecraft you're using, this either means you didn't hit the update button or they are running a pre-release server.
This server responded with an invalid server key
This is actually a measure to stop an exploit with modified servers, but has a bug which causes it to have false positives in half of the connections.
Failed to check session lock, aborting
You may only see this in the crash log. Most likely, there is an active lock on part of the world (either the terrain itself, or more likely an NBT saved element such as a player or chest) that a third party editor has left locked (or that you didn't close). Delete
session.lock in the world save folder.
Internal Exception: io.netty.handler.timeout.ReadTimeoutException
The game could not keep up with the server, or that your computer cannot process the packets fast enough, causing you to fall too far out of sync with the server. You can fix this by getting a faster/clearer internet connection, or a faster computer, or simply closing off any programs that may be hogging your bandwidth/computer processing power.
An error that can occur at any point while playing the game.
This is not an error message, but rather a crash message. Minecraft sometimes crashes on startup, even when you are playing vanilla. This typically means that one or more Block IDs conflict with each other. This normally occurs on heavily modded clients or modpacks, such as Tekkit or Feed The Beast.
RuntimeException: No OpenGL context found in the current thread.
org.lwjgl.LWJGLException: Pixel format not accelerated
If the player is given this message when starting Minecraft, it means that they do not have a graphics card that can handle Minecraft. It could be as simple as updating graphics drivers, but this doesn't happen often.
Your game has run out of memory. Heavily modded clients require a lot more memory (and processing power) as it has more blocks loaded onto it. You can stop this error by increasing the amount of memory that is allocated to java, close down any programs that you don't need (to free up memory) or reduce the number of mods/upgrade to the 64-bit version of Java in order to allocate more. See here for information*.
* Not Minecraft-specific
These errors will only appear if you're using a modified version of the Minecraft client.