Similar to this question on the bugs in Minecraft, I would like a complete list of what error codes exist in Minecraft and how they occur, as well as how they can be resolved.

Here are some, but probably not all, of the error codes that may occur when playing Minecraft:
Multiplayer Errors

An error that only happens when you’re playing on or attempting to log in/out of a multiplayer server.
Connection refused: connect

This means:

There is no Minecraft server online on the IP Address:Port you put in
The entire server (not just Minecraft) cannot be accessed

You can try:

Confirm you’ve entered the correct server address
Contacting the server owner/administrator or a known operator (OP) and explain the situation.

End of stream

This means:

The server has stopped sending information back to the client for some reason.

You can try:

Close and Reopen Minecraft and attempt to log in again.
If problems persist, contact the server owner/administrator or a known Operator (OP) and explain the situation

Failed to login: Bad Login

This means:

You’ve attempted to log 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.

You can try:

Confirm that you are running the correct version of Minecraft for the server you wish to connect to. (Sometimes, server operators may not update the server straight away, but instead wait for their particular mods/server admin tools to catch up).
Check your network connection and your ping (lag) time. Your client may be getting kicked because the network is too slow to respond in time.

Internal Exception: io.netty.handler.timeout.ReadTimeoutException

This means:

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 try:

Getting a faster/clearer internet connection, a faster computer, or simply closing any programs that may be hogging your bandwidth/computer processing power. Remember to check the task tray on Windows – applications like Dropbox can consume a lot of bandwidth.

java.io.IOException: Server returned HTTP response code: 503

This means:

The server cannot authenticate who you are because minecraft.net is down

You can try:

Check the Minecraft Update News and the Mojang pages to check if there are planned outages (server maintenance, website updates etc)
Try again later
If this persists and there isn’t any reported outages, contact the server owner/administrator or a known operator (OP) and explain the situation

java.net.SocketException: Connection reset

This means:

The server has shut down or is doing something very intensive.
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.
Servers sometimes return this when in the process of shutting down or starting up, which may happen if the server does nightly backups/restarts. (Remember, your ‘night’ may be different to the server, especially if it is in another country!)

You can try:

Try logging in again later.
If this persists, contact the server owner/administrator or a known Operator (OP) and explain the situation.

Outdated client!

This means:

You’re connecting to a server on a newer version than the Minecraft you’re using

You can try:

Change your Minecraft version to the one used by the server, using the Profile Editor in the Launcher

Outdated server!

This means:

You’re connecting to a server on an older version than the Minecraft you’re using

You can try:

Change your Minecraft version to the one used by the server, using the Profile Editor in the Launcher
Note: Sometimes, server operators may not update the server straight away, but instead wait for their particular mods/server admin tools to catch up, especially for pre-release versions

This server responded with an invalid server key

This means:

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.

You can try:

Attempt to log in again.

Took to long to log in

This means:

The server cannot authenticate who you are because minecraft.net wasn’t responding

You can try:

Try again later
Check the Minecraft Update News and the Mojang pages to check if there are planned outages (server maintenance, website updates etc)
If this persists and there isn’t any reported outages, contact the server owner/administrator or a known Operator (OP) and explain the situation.

User Not Premium

This means:

“Free”/cracked/hacked Minecraft clients do not pass the minecraft.net authentication.

You can try

If you want to play on multiplayer servers you have to buy the game.

You are not whitelisted on this server

This means:

You have not been added to (or have been removed from) the list of people who are allowed to connect to the server.

You can try:

Contacting the server owner/administrator or a known operator (OP) and explain the situation.

Crashes

An error that can occur at any point while playing the game.
Failed to check session lock, aborting

This means:

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).
You may only see this in the crash log.

You can try:

Delete session.lock in the world save folder (contact an admin if you aren’t one and explain the situation).

java.lang.NullPointerException

This means:

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.

You can try:

Relaunching the game
ForgeModLoader now has an in-built block ID resolver/alert. So, if there’s a conflict: The game will stop loading and ask you to fix them. It even gives you a little file that tells you what blocks are conflicting with each other, and the IDs they’re conflicting for.

Runtime Errors
com.google.gson.JsonSyntaxException

or
com.google.gson.stream.MalformedJsonException

Minecraft uses an external package by Google to parse all the json formatting, which is what the NBT format is based on.

This means:

Your world may be corrupted.
There is invalid JSON/NBT formatting in your save files; tag names are defined as a “variable” instead of a string.

You can try:

Going through the save files and searching for the malformed formatting. (See this example code to clear using Javascript)
This means {Tag:{ … }} instead of {“Tag”:{ … }}, with … representing its compounded tags/contents.
Restoring your save to a previous backup where the problem has not occurred, and removing any mods that may have caused this.

java.lang.OutOfMemoryError

This means:

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 try:

Increasing the amount of memory that is allocated to java. See the posts here:
How do you allocate more RAM to Minecraft?
Why allocate more RAM to Minecraft?
Close down any programs that you don’t need (to free up memory)
Reduce the number of mods
Upgrade to the 64-bit version of Java (requires a 64-bit computer).

See here for information (not Minecraft-specific).
RuntimeException: No OpenGL context found in the current thread.

or
org.lwjgl.LWJGLException: Pixel format not accelerated

This means:

Your graphics card or driver is unable to handle Minecraft.

You can try:

It could be as simple as updating graphics drivers, but this doesn’t happen often.
If this error occurs after installing or updating the operating system, you probably have default graphics drivers that do not support OpenGL. Install the drivers provided by your graphics card manufacturer instead of the default drivers.
Otherwise, you may need to purchase a newer graphics card for your PC.

References and additional information

Some are taken from this post on the Yogscast forums.
Official Minecraft support pages
The bug tracker might have information about bugs causing these errors as well. You can look for your error in the Hopper, too.

Failed to login: Bad Login is also an error thrown when a) a non-vanilla client attempts to connect to a vanilla server (and vice versa) (only happens in some situations) and b) used to show up when the client had a newer version than the server (this may be fixed up now). –  Qix Dec 22 ’12 at 22:04

I know when modding the client/server from scratch, I would get Bad Login all the time (even though the login systems were fine). The problems were version numbers; once they correlated with each other the user could connect fine. –  Qix Dec 22 ’12 at 22:05

Further, Connection Reset also occurs when the user’s internet connection dies or something in between the user and the server gets disconnected (basically, Connection Reset [being a very broad and common TCP/IP error] means something happened to disconnect the connection in an abrupt and unexpected way). –  Qix Dec 22 ’12 at 22:07

Right, you have missed 1 as far as I know “Cannot have username longer than 16 characters” –  user48382 May 11 ’13 at 19:24

An access violation / segmentation fault occurs when a program attempts to access memory that it has not been assigned. This is a very broad type of error with many possible causes, but it is almost always the result of a software bug.

Find the part of the crash log that states “problematic frame”, and see if it matches any of the ones found below:

Problematic frame: ig4icd32.dll, ig4dev32.dll, ig7icd64.dll, ig7dev64.dll

What is this? Drivers for Intel integrated graphics processors, commonly found in laptops.

Updating these drivers may be sufficient, and is usually a good idea anyway.

If you have another graphics processor / card (e.g. ATi, nVidia), you may want to run on that device instead, as they tend to be better supported and deliver more performance (at the cost of battery life).

Problematic frame: atioglx1.dll, atioglx2.dll, atioglx3.dll, atioglxx.dll

What is this? ATi OpenGL drivers. Minecraft uses OpenGL for its 3D rendering.

Updating your graphics drivers is usually a good place to start–usually, because see below.

Did the error start appearing only recently? A recent update may actually be the culprit. See whether downgrading/rolling back to a previous version resolves the issue.

Problematic frame: jvm.dll, libjvm.so

What is this? The actual Java Virtual Machine (JVM).

Install the latest version in the Java line you have (6, 7, 8 …). While uncommon, a bug may have slipped into the JVM.

If other parts of your computer are acting up as well, you may have hardware memory errors. Try running a memory check.

Is there a list of error codes for Minecraft?