Skip to content

Commit

Permalink
user-friendly messages for EOFError network errors
Browse files Browse the repository at this point in the history
  • Loading branch information
elfassy authored Oct 3, 2019
1 parent 27718e0 commit c0b43b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/stripe/stripe_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ def execute_request(method, path,
# The original error message is also appended onto the final exception for
# full transparency.
NETWORK_ERROR_MESSAGES_MAP = {
EOFError => ERROR_MESSAGE_CONNECTION,
Errno::ECONNRESET => ERROR_MESSAGE_CONNECTION,
Errno::ETIMEDOUT => ERROR_MESSAGE_TIMEOUT_CONNECT,
Errno::EHOSTUNREACH => ERROR_MESSAGE_CONNECTION,
Errno::ECONNREFUSED => ERROR_MESSAGE_CONNECTION,
SocketError => ERROR_MESSAGE_CONNECTION,

Expand Down

0 comments on commit c0b43b9

Please sign in to comment.