Remove try catches choking all exceptions (#5206)
* remove some try catches choking all exceptions * rename ExceptionExtension to ReportAsWarning, show full stack instead of just message * dotnet-migrate try catch clean-up * fix migration test failures
This commit is contained in:
parent
a442449c55
commit
5fea7c3ae6
18 changed files with 212 additions and 71 deletions
|
@ -3,12 +3,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Build.Construction;
|
||||
using Microsoft.DotNet.Internal.ProjectModel;
|
||||
using Microsoft.DotNet.Internal.ProjectModel.Graph;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using Microsoft.DotNet.Cli.Utils.ExceptionExtensions;
|
||||
using Microsoft.DotNet.Cli.Sln.Internal;
|
||||
using Microsoft.DotNet.ProjectJsonMigration.Rules;
|
||||
using Microsoft.DotNet.Tools.Common;
|
||||
|
@ -87,14 +88,22 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
try
|
||||
{
|
||||
File.Delete(Path.Combine(rootsettings.ProjectDirectory, "project.json"));
|
||||
} catch {}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.ReportAsWarning();
|
||||
}
|
||||
|
||||
foreach (var projectDependency in projectDependencies)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(projectDependency.ProjectFilePath);
|
||||
} catch { }
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.ReportAsWarning();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue