mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 18:40:50 +08:00 
			
		
		
		
	Rename 'Demo' example to 'Showcase'
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							efa3d3b130
						
					
				
				
					commit
					6a5c507936
				
			
							
								
								
									
										31
									
								
								examples/Console/Showcase/ExceptionGenerator.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								examples/Console/Showcase/ExceptionGenerator.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
using System;
 | 
			
		||||
using Spectre.Console;
 | 
			
		||||
 | 
			
		||||
namespace Showcase
 | 
			
		||||
{
 | 
			
		||||
    public static class ExceptionGenerator
 | 
			
		||||
    {
 | 
			
		||||
        public static Exception GenerateException()
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                SomeOperation();
 | 
			
		||||
                throw new InvalidOperationException();
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception ex)
 | 
			
		||||
            {
 | 
			
		||||
                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