diff --git a/src/Paket.Core/DependenciesFileParser.fs b/src/Paket.Core/DependenciesFileParser.fs index 5887a7d800..6bca849331 100644 --- a/src/Paket.Core/DependenciesFileParser.fs +++ b/src/Paket.Core/DependenciesFileParser.fs @@ -225,7 +225,13 @@ module DependenciesFileParser = match trimmed with | _ when String.IsNullOrWhiteSpace line -> Empty(line) - | String.StartsWith "source" _ as trimmed -> Remote(RemoteParserOption.PackageSource(PackageSource.Parse(trimmed))) + | String.StartsWith "source" _ as trimmed -> + try + let source = PackageSource.Parse(trimmed) + Remote(RemoteParserOption.PackageSource(source)) + with e -> + traceWarnfn "could not parse package source %s (%s)" trimmed e.Message + reraise () | String.StartsWith "cache" _ as trimmed -> Remote(RemoteParserOption.Cache(Cache.Parse(trimmed))) | String.StartsWith "group" _ as trimmed -> Group(trimmed.Replace("group ","")) | String.StartsWith "nuget" trimmed -> diff --git a/src/Paket.Core/Domain.fs b/src/Paket.Core/Domain.fs index a5c74cb2bb..1c0c2a53bb 100644 --- a/src/Paket.Core/Domain.fs +++ b/src/Paket.Core/Domain.fs @@ -94,7 +94,7 @@ let GroupName(name:string) = type DomainMessage = | DirectoryDoesntExist of DirectoryInfo | DependenciesFileNotFoundInDir of DirectoryInfo - | DependenciesFileParseError of FileInfo + | DependenciesFileParseError of FileInfo * exn | LockFileNotFound of DirectoryInfo | LockFileParseError of FileInfo | ReferencesFileParseError of FileInfo @@ -127,8 +127,8 @@ type DomainMessage = sprintf "Directory %s does not exist." di.FullName | DependenciesFileNotFoundInDir(di) -> sprintf "Dependencies file not found in %s." di.FullName - | DependenciesFileParseError(fi) -> - sprintf "Unable to parse %s." fi.FullName + | DependenciesFileParseError(fi,e) -> + sprintf "Unable to parse %s. (%s)" fi.FullName e.Message | LockFileNotFound(di) -> sprintf "Lock file not found in %s. Create lock file by running paket install." di.FullName | LockFileParseError(fi) -> diff --git a/src/Paket.Core/Environment.fs b/src/Paket.Core/Environment.fs index 20c6e13f66..c3526bb78d 100644 --- a/src/Paket.Core/Environment.fs +++ b/src/Paket.Core/Environment.fs @@ -33,8 +33,8 @@ module PaketEnv = else try ok (DependenciesFile.ReadFromFile(fi.FullName)) - with _ -> - fail (DependenciesFileParseError fi) + with e -> + DependenciesFileParseError(fi,e) |> fail let! lockFile = let fi = FileInfo(Path.Combine(directory.FullName, Constants.LockFileName)) diff --git a/src/Paket.Core/NugetConvert.fs b/src/Paket.Core/NugetConvert.fs index 3f5dbb95df..3f5b30c1ff 100644 --- a/src/Paket.Core/NugetConvert.fs +++ b/src/Paket.Core/NugetConvert.fs @@ -270,7 +270,7 @@ let createDependenciesFileR (rootDirectory : DirectoryInfo) nugetEnv mode = try DependenciesFile.ReadFromFile dependenciesFileName |> ok - with _ -> DependenciesFileParseError (FileInfo dependenciesFileName) |> fail + with e -> DependenciesFileParseError (FileInfo dependenciesFileName, e) |> fail |> lift addPackages let create() = diff --git a/src/Paket.Core/Paket.Core.fsproj b/src/Paket.Core/Paket.Core.fsproj index 7b5dd63c6e..3ded1de90a 100644 --- a/src/Paket.Core/Paket.Core.fsproj +++ b/src/Paket.Core/Paket.Core.fsproj @@ -85,8 +85,8 @@ - +