Skip to content
This repository
Browse code

Removed uselless begin and end for exception inside the method

  • Loading branch information...
commit 5cbfa1acce8b77f2e4ce2ba399e660fb6ed1ec51 1 parent ea90600
Michael Nikitochkin authored March 28, 2013

Showing 1 changed file with 11 additions and 13 deletions. Show diff stats Hide diff stats

  1. 24  lib/rake/application.rb
24  lib/rake/application.rb
@@ -156,19 +156,17 @@ def parse_task_string(string)
156 156
 
157 157
     # Provide standard exception handling for the given block.
158 158
     def standard_exception_handling
159  
-      begin
160  
-        yield
161  
-      rescue SystemExit => ex
162  
-        # Exit silently with current status
163  
-        raise
164  
-      rescue OptionParser::InvalidOption => ex
165  
-        $stderr.puts ex.message
166  
-        exit(false)
167  
-      rescue Exception => ex
168  
-        # Exit with error message
169  
-        display_error_message(ex)
170  
-        exit_because_of_exception(ex)
171  
-      end
  159
+      yield
  160
+    rescue SystemExit => ex
  161
+      # Exit silently with current status
  162
+      raise
  163
+    rescue OptionParser::InvalidOption => ex
  164
+      $stderr.puts ex.message
  165
+      exit(false)
  166
+    rescue Exception => ex
  167
+      # Exit with error message
  168
+      display_error_message(ex)
  169
+      exit_because_of_exception(ex)
172 170
     end
173 171
 
174 172
     # Exit the program because of an unhandle exception.

0 notes on commit 5cbfa1a

Please sign in to comment.
Something went wrong with that request. Please try again.