A measure of quality of an error-correcting code is the maximum number of errors that it is able to correct. We show that a suitable notion of "number of errors" e makes sense for any quantum or classical system in the presence of arbitrary interactions. Thus, e-error-correcting codes protect information without requiring the usual assumptions of independence. We prove the existence of large codes for both quantum and classical information. By viewing error-correcting codes as subsystems, we relate codes to irreducible representations of operator algebras and show that noiseless subsystems are infinite-distance error-correcting codes.