rework of ErrorCode