Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/FsXaml.Wpf/Utilities.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ module InjectXaml =
writer.WriteNode(reader)
with
| :? XamlException as xamlException -> // From writer

// Explicitly close the writer. Otherwise, as it is disposed
// when it goes out of scope it may raise an exception, which will
// prevent the propagation of the helpful one we're just about to raise
try writer.Close () with _ -> ()

let message =
if reader.HasLineInfo then
sprintf "Error parsing XAML contents from %s.\n Error at line %d, column %d.\n Element beginning at line %d, column %d." file xamlException.LineNumber xamlException.LinePosition reader.LineNumber reader.LinePosition
Expand Down