Simplified exception handling
This commit is contained in:
		@@ -114,16 +114,15 @@ void show_words() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main() {
 | 
			
		||||
    sc::term term {STDERR_FILENO};
 | 
			
		||||
    try {
 | 
			
		||||
        sc::term term {STDERR_FILENO};
 | 
			
		||||
        show_rows_cols(term);
 | 
			
		||||
        show_grayscale_bar();
 | 
			
		||||
        show_hue_bars();
 | 
			
		||||
        show_words();
 | 
			
		||||
        show_progress(term);
 | 
			
		||||
    } catch (const std::exception& ex) {
 | 
			
		||||
        term.reset();
 | 
			
		||||
        std::cerr << ex.what() << std::endl;
 | 
			
		||||
        std::cerr << sc::io::reset << ex.what() << std::endl;
 | 
			
		||||
        return EXIT_FAILURE;
 | 
			
		||||
    }
 | 
			
		||||
    return EXIT_SUCCESS;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user