# The -0502 errors: from the POV of a support helper
## Background: Understanding the error codes
Anytime you get an error, whether its 101-0502, 002-0502, 118-0502, as long as it ends with -0502, it usually means the same exact thing: Failure to connect to the server or service.
In order to explain, I need to teach you the meaning of the error codes. They are not just random numbers. They are usually formatted as such:
ABB-CCCC
Where:
* A is the console: 0 means 3DS family, 1 means Wii U.
* BB is the two numbers that make up the protocol the error occurred in. For a full list, see https://nintendo-wiki.pretendo.network/docs/nex/protocols/
* Note: On 3DS systems, protocols under "Nintendo Only" may have the leading "1" removed as this is where the "0" is placed.
* The only exception to this rule I've seen is account errors, which will be shown as 002-CCCC or 102-CCCC depending on console.
* CCCC is the actual four digit number that says what went wrong. This is where the **0502** is in.
From my understanding, and my personal experience self-hosting these servers (and often running into these errors), they all mean a failure to connect to something related to the protocol (the one defined by BB in the error code). Here are the ones I have seen:
## The -0502 Errors
A is either **0** or **1** for 3DS and Wii U respectively. I'm only putting down the errors I have seen happen.
A01-0502: Friend server. This was more frequent until a [patch](https://github.com/PretendoNetwork/friends/commit/71f47f9ffc9771d41646bb45685793e550379ee8) was made to fix the way the friends server handled things internally overall, and this seems to be a lot less frequent. This could be an issue with your connection. Ever since the patch was rolled out I've only experienced this when self-hosting. **You should not have to worry about this but if it does, look for solutions, and if all else fails ask a support helper.**
A06-0502: Secure server. **From my understanding** this is what happens when the game's authentication server basically validates your connection and sends you to the Secure server (where the actual game server stuff is done). There are lots of reasons for this happening, but if you're on Production servers its likely some issue on your side and not the server side. I've only run into this when self-hosting. **You should not have to worry about this.**
A18-0502: P2P connection. The game servers (to my knowledge) don't actually handle things like your movements or shots or all of that - once you're in game, it's all P2P. For example, in Splatoon, the game server will use matchmaking, but when it comes to lobbies and actual online gameplay, it is all peer-to-peer. I've only seen this happen in Splatoon when the lobby's host disconnects, or for some other reason there is a P2P failure to connect. There is no known solution for this, but it is relatively rare and overall not a big issue when it happens. **You should not have to worry about this.**
## Other -0502 Errors if they weren't mentioned above
Just skip to the conclusion.
## Conclusion
Any time there is an -0502 error, it just means "failure to connect to something". Pretendo is still a **huge** WIP, so the number one thing to have is patience. But as time goes on these errors will show up less frequently.