# File lib/rake.rb, line 1760
1760:     def standard_exception_handling
1761:       begin
1762:         yield
1763:       rescue SystemExit, GetoptLong::InvalidOption => ex
1764:         # Exit silently
1765:         exit(1)
1766:       rescue Exception => ex
1767:         # Exit with error message
1768:         $stderr.puts "rake aborted!"
1769:         $stderr.puts ex.message
1770:         if options.trace
1771:           $stderr.puts ex.backtrace.join("\n")
1772:         else
1773:           $stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
1774:           $stderr.puts "(See full trace by running task with --trace)"
1775:         end
1776:         exit(1)
1777:       end    
1778:     end