public async Task <PackageResult> Process(string targetName, IReadOnlyList <string> dependencies)
        {
            try
            {
                var dependencyResults = await GetDependencyResults(dependencies);

                return(PackageResult.InvestigationTarget(targetName, dependencyResults));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Error processing supplied data file");
                return(PackageResult.Failed(targetName, "An error occured - " + ex.Message));
            }
        }
        private async Task <PackageResult> Process(SourcePackageFile file)
        {
            try
            {
                var dependencies = SourcePackageFileReader.Read(file);
                if (dependencies.WasFailure)
                {
                    return(PackageResult.Failed(file.Name, dependencies.ErrorString));
                }

                return(await Process(file.Name, dependencies.Value));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Error processing supplied data file");
                return(PackageResult.Failed(file.Name, "An error occured - " + ex.Message));
            }
        }
        private async Task <PackageResult> GetPackageAndDependencies(string id)
        {
            try
            {
                var moreInformation = MoreInformationRepository.Get(id);

                var knownReplacement = KnownReplacementsRepository.Get(id);
                if (knownReplacement.Some)
                {
                    return(PackageResult.KnownReplacement(id, knownReplacement.Value));
                }

                var package = await GetReleaseOrPrereleasePackage(id);

                var dependencyResults = await GetDependencyResults(package.Dependencies);

                return(PackageResult.Success(package, dependencyResults, moreInformation));
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Error processing package {package}", id);
                return(PackageResult.Failed(id, "An error occured - " + ex.Message));
            }
        }