Error codes implemented as enum for readability