mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-20 09:05:49 +08:00
Use file scoped namespace declarations
This commit is contained in:
committed by
Phil Scott
parent
1dbaf50935
commit
ec1188b837
@@ -1,30 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Spectre.Console.Examples
|
||||
namespace Spectre.Console.Examples;
|
||||
|
||||
public static class ExceptionGenerator
|
||||
{
|
||||
public static class ExceptionGenerator
|
||||
public static Exception GenerateException()
|
||||
{
|
||||
public static Exception GenerateException()
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
SomeOperation();
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ex;
|
||||
}
|
||||
SomeOperation();
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
private static void SomeOperation()
|
||||
catch (Exception ex)
|
||||
{
|
||||
SomeOperationGoingWrong();
|
||||
}
|
||||
|
||||
private static void SomeOperationGoingWrong()
|
||||
{
|
||||
throw new InvalidOperationException("Something went very wrong!");
|
||||
return ex;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SomeOperation()
|
||||
{
|
||||
SomeOperationGoingWrong();
|
||||
}
|
||||
|
||||
private static void SomeOperationGoingWrong()
|
||||
{
|
||||
throw new InvalidOperationException("Something went very wrong!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user