Use the power of enum

Each error code now has an associated string id. This allows every error message to easily be localized and handled.