Method: Tetra::Subcommand#checking_exceptions
- Defined in:
- lib/tetra/ui/subcommand.rb
#checking_exceptions ⇒ Object
handles most fatal exceptions
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/tetra/ui/subcommand.rb', line 89 def checking_exceptions yield rescue Errno::EACCES => e $stderr.puts e rescue Errno::ENOENT => e $stderr.puts e rescue Errno::EEXIST => e $stderr.puts e rescue NoProjectDirectoryError => e $stderr.puts "#{e.directory} is not a tetra project directory, see \"tetra init\"" rescue GitAlreadyInitedError $stderr.puts "This directory is already a tetra project" rescue ExecutionFailed => e $stderr.puts "Failed to run `#{e.commandline}` (exit status #{e.status})" rescue Interrupt $stderr.puts "Execution interrupted by the user" end |