Taken from this post on the Yogscast forums, here are some, but probably not all, of the error codes found when connecting to servers.
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.
The errors below this line can occur when logging into a server, but do not have to.
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.