From 436fdc2ea828d5bc4fa1a1aa7d4b796ac77cc932 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 26 Aug 2010 14:48:29 -0700 Subject: More on mantis #4985 --- OpenSim/Region/DataSnapshot/SnapshotStore.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/DataSnapshot/SnapshotStore.cs') diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index 3977394..aa3d2ff 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs @@ -99,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot { String path = DataFileNameFragment(provider.GetParentScene, provider.Name); - using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + try { - snapXWriter.Formatting = Formatting.Indented; - snapXWriter.WriteStartDocument(); - data.WriteTo(snapXWriter); - snapXWriter.WriteEndDocument(); + using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + { + snapXWriter.Formatting = Formatting.Indented; + snapXWriter.WriteStartDocument(); + data.WriteTo(snapXWriter); + snapXWriter.WriteEndDocument(); + } } + catch (Exception e) + { + m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message); + } + } //mark provider as not stale, parent scene as stale @@ -214,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot #region Helpers private string DataFileNameFragment(Scene scene, String fragmentName) { - return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName) + "_" + fragmentName, "xml")); + return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml")); } private string DataFileNameScene(Scene scene) -- cgit v1.1