Skip to content

Commit

Permalink
catch all exceptions that bubble
Browse files Browse the repository at this point in the history
don't want to crash vs
  • Loading branch information
darrenkopp committed Jan 9, 2014
1 parent 6646c4c commit a70d210
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
28 changes: 21 additions & 7 deletions SassyStudio.2012/Editor/GenerateCssOnSave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,33 @@ private void OnFileActionOccurred(object sender, TextDocumentFileActionEventArgs

private void GenerateRootDocument(DateTime time, string path)
{
GenerateCss(time, path);
GenerateAllReferencing(time, path);
try
{
GenerateCss(time, path);
GenerateAllReferencing(time, path);
}
catch (Exception ex)
{
Logger.Log(ex, "Unhandled exception.");
}
}

private void GenerateAllReferencing(DateTime time, string path)
{
var source = new FileInfo(path);
var documents = DocumentCache.Documents;
try
{
var source = new FileInfo(path);
var documents = DocumentCache.Documents;

foreach (var document in documents)
foreach (var document in documents)
{
if (IsReferenced(source, document, new HashSet<ISassDocument>()))
GenerateCss(time, document.Source.FullName);
}
}
catch (Exception ex)
{
if (IsReferenced(source, document, new HashSet<ISassDocument>()))
GenerateCss(time, document.Source.FullName);
Logger.Log(ex, "Unhandled exception.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion SassyStudio.2012/SassyStudioPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace SassyStudio
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "0.8.8.3", IconResourceID = 400)]
[InstalledProductRegistration("#110", "#112", "0.8.8.4", IconResourceID = 400)]
[GuidAttribute(Guids.guidSassyStudioPkgString)]
[ProvideAutoLoad(UIContextGuids80.SolutionExists)]
[ProvideOptionPage(typeof(ScssOptions), "Sassy Studio", "General", 101, 102, true, new[] { "CSS", "SCSS" })]
Expand Down
2 changes: 1 addition & 1 deletion SassyStudio.2012/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="SassyStudio..141b7a26-b79d-4ca0-9102-77e7cc7e0ec8" Version="0.8.8.3" Language="en-US" Publisher="Darren Kopp" />
<Identity Id="SassyStudio..141b7a26-b79d-4ca0-9102-77e7cc7e0ec8" Version="0.8.8.4" Language="en-US" Publisher="Darren Kopp" />
<DisplayName>SassyStudio</DisplayName>
<Description xml:space="preserve">Provides some support for sass files in visual studio</Description>
<MoreInfo>https://github.com/darrenkopp/SassyStudio</MoreInfo>
Expand Down

0 comments on commit a70d210

Please sign in to comment.