private Exception TryGetPackage(string packageId, out EtlPackage package)
 {
     try
     {
         package = _agent.GetEtlPackage(packageId);
         return(null);
     }
     catch (Exception exc)
     {
         package = null;
         return(exc);
     }
 }
        private Exception TryCopyPackage(string packageId, bool overwrite)
        {
            try
            {
                var package = _agent.GetEtlPackage(packageId);
                if (package == null)
                {
                    return(new InvalidOperationException(string.Format("Package \"{0}\" does not exist", packageId)));
                }

                _agentToCopy.DeployEtlPackage(package, new EtlPackageDeploymentOptions
                {
                    Overwrite = overwrite
                });
                return(null);
            }
            catch (Exception exc)
            {
                return(exc);
            }
        }