mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Simplify rescue catching
				
					
				
			This commit is contained in:
		
							
								
								
									
										8
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								Rakefile
									
									
									
									
									
								
							@@ -28,14 +28,8 @@ task :fetch_ace_modes do
 | 
				
			|||||||
  begin
 | 
					  begin
 | 
				
			||||||
    ace_github_modes = (open("https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode").read)
 | 
					    ace_github_modes = (open("https://api.github.com/repos/ajaxorg/ace/contents/lib/ace/mode").read)
 | 
				
			||||||
    File.write(ACE_FIXTURE_PATH, ace_github_modes)
 | 
					    File.write(ACE_FIXTURE_PATH, ace_github_modes)
 | 
				
			||||||
  rescue => e
 | 
					  rescue OpenURI::HTTPError, SocketError
 | 
				
			||||||
    case e
 | 
					 | 
				
			||||||
    when OpenURI::HTTPError
 | 
					 | 
				
			||||||
    when SocketError
 | 
					 | 
				
			||||||
      # no internet? no problem.
 | 
					      # no internet? no problem.
 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
      raise e
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user