Skip to content

Commit

Permalink
Merge pull request #730 from Thorium/master
Browse files Browse the repository at this point in the history
If Paket crashes to some invalid user file: let's display the file to user so he/she can fix it.
  • Loading branch information
forki committed Mar 28, 2015
2 parents 0b29ce4 d710907 commit 84c6891
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Paket.Core/BindingRedirects.fs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 50,14 @@ let internal setRedirect (doc:XDocument) bindingRedirect =

/// Applies a set of binding redirects to a single configuration file.
let private applyBindingRedirects bindingRedirects (configFilePath:string) =
let config = XDocument.Load(configFilePath, LoadOptions.PreserveWhitespace)
let config =
try
XDocument.Load(configFilePath, LoadOptions.PreserveWhitespace)
with
| :? System.Xml.XmlException as ex ->
Logging.verbosefn "Illegal xml in file: %s" configFilePath
raise ex

let config = Seq.fold setRedirect config bindingRedirects
config.Save configFilePath

Expand Down

0 comments on commit 84c6891

Please sign in to comment.