Refactor error constants in crud module