Implemented error codes as enums for readability