Skip to content

Commit a7e58ed

Browse files
committed
Adding try/catch around saving the config files in the package action, this is a common exception when write permission is not present in someone's installation
1 parent 391f6c2 commit a7e58ed

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/UmbracoFileSystemProviders.Azure.Installer/PackageActions.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
namespace Our.Umbraco.FileSystemProviders.Azure.Installer
88
{
9+
using System;
910
using System.Web;
11+
1012
using Microsoft.Web.XmlTransform;
13+
1114
using umbraco.cms.businesslogic.packager.standardPackageActions;
1215
using umbraco.interfaces;
16+
using global::Umbraco.Core.Logging;
1317

1418
public class PackageActions
1519
{
@@ -69,7 +73,17 @@ private bool Transform(string packageName, System.Xml.XmlNode xmlData, bool unin
6973
// If we made it here, sourceDoc now has transDoc's changes
7074
// applied. So, we're going to save the final result off to
7175
// destDoc.
72-
xmlDoc.Save(HttpContext.Current.Server.MapPath(sourceDocFileName));
76+
try
77+
{
78+
xmlDoc.Save(HttpContext.Current.Server.MapPath(sourceDocFileName));
79+
}
80+
catch (Exception e)
81+
{
82+
// Log error message
83+
var message = "Error executing TransformConfig package action (check file write permissions): " + e.Message;
84+
LogHelper.Error(typeof(TransformConfig), message, e);
85+
return false;
86+
}
7387
}
7488
}
7589
}

0 commit comments

Comments
 (0)