diff --git a/lib/pwned/password.rb b/lib/pwned/password.rb
index <HASH>..<HASH> 100644
--- a/lib/pwned/password.rb
+++ b/lib/pwned/password.rb
@@ -35,14 +35,16 @@ module Pwned
     end
 
     def get_hashes
-      open("#{API_URL}#{hashed_password[0..(HASH_PREFIX_LENGTH-1)]}", @request_options) do |io|
-        @hashes = io.read
+      begin
+        open("#{API_URL}#{hashed_password[0..(HASH_PREFIX_LENGTH-1)]}", @request_options) do |io|
+          @hashes = io.read
+        end
+        @hashes
+      rescue Timeout::Error => e
+        raise Pwned::TimeoutError, e.message
+      rescue => e
+        raise Pwned::Error, e.message
       end
-      @hashes
-    rescue Timeout::Error => e
-      raise Pwned::TimeoutError, e.message
-    rescue => e
-      raise Pwned::Error, e.message
     end
 
     def match_data
I prefer begin/rescue/end syntax