The wifi feature on this game isn't really all that great. It crashes and errors a lot. If your friend list is also not working then there might be something wrong with your 3DS itself since the friend's list has nothing to do with Animal Crossing New Leaf
I had way more connection issues on my old 2ds, then I upgraded to the new 3ds xl and I've gotten way fewer Resetti sightings. What model 3ds do you have? That might have something to do with it.
also, if you got an error code, write it down and look it up. Perhaps nintendo is doing server maintenance right now?
Sometimes the internet on my 3ds goes out because I'm in a bad spot of my house that doesn't get good WiFi. Maybe the part of your house that you're in has bad WiFi?