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:
Krzysztof Wicher 2017-01-12 15:42:36 -08:00 committed by Piotr Puszkiewicz
parent a442449c55
commit 5fea7c3ae6
18 changed files with 212 additions and 71 deletions

View file

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>dotnet-throwingtool</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
</PropertyGroup>
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
</BuiltProjectOutputGroupOutput>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.3</Version>
</PackageReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,12 @@
using System;
namespace AppThrowing
{
class MyException : Exception
{
static void Main(string[] args)
{
throw new MyException();
}
}
}

View file

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-throwingtool">
<Version>1.0.0</Version>
</DotNetCliToolReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../pkgs" />
</packageSources>
</configuration>

View file

@ -0,0 +1,8 @@
using System;
class Program
{
static void Main(string[] args)
{
}
}