http-exceptions 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rvmrc +1 -0
- data/README.md +1 -1
- data/http-exceptions.gemspec +5 -5
- data/lib/http/exceptions.rb +0 -16
- data/lib/http/exceptions/configuration.rb +8 -0
- data/lib/http/exceptions/version.rb +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca2709a732ea71caea99f426982e5d2926c65319
|
4
|
+
data.tar.gz: 8ffa2895cdaac41c5a49d789979c5a452f453b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c00c7cec6eea8270ffbc97b1b6a75e1442729cb2f155e3c1e91de0f0b9a3dd933b33294296481cc064636e6038f19b2f4a4a7cae847088f1fa88c08d58ba681f
|
7
|
+
data.tar.gz: e8729b7f920b285d4e43754a39d2913130d2516f1dfd62431a2a2e8c324b16d552e46f3df106cb7708e87931d0cf5ca51389dd6943516cbf0a5d6a25d5974267
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 2.2.0@http-exceptions --create
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Http::Exceptions
|
4
4
|
|
5
|
-
Http::Exceptions provides an easy way to rescue exceptions that might be thrown by your Http library.
|
5
|
+
Http::Exceptions provides an easy way to rescue exceptions that might be thrown by your Http library. This was developed at Rainforest QA - you can read more in [Introducing Http::Exceptions](https://www.rainforestqa.com/blog/2014-08-15-introducing-http-exceptions/) over on our blog.
|
6
6
|
|
7
7
|
If you're using a library such as the excellent [HTTParty](https://github.com/jnunemaker/httparty), you still have to deal with various types of exceptions. In an ideal world, the return code of the HTTP request would be the sole indicator of failures, but HTTP libraries can raise a large number of exceptions (such as `SocketError` or `Net::ReadTimeout`) that you need to handle.
|
8
8
|
|
data/http-exceptions.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'http/exceptions/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "http-exceptions"
|
8
8
|
spec.version = Http::Exceptions::VERSION
|
9
|
-
spec.authors = ["Simon Mathieu"
|
10
|
-
spec.email = ["simon.math@gmail.com"
|
11
|
-
spec.summary = %q{An easy way to rescue exceptions that might be thrown by your
|
12
|
-
spec.description = %q{An easy way to rescue exceptions that might be thrown by your
|
13
|
-
spec.homepage = "
|
9
|
+
spec.authors = ["Simon Mathieu"]
|
10
|
+
spec.email = ["simon.math@gmail.com"]
|
11
|
+
spec.summary = %q{An easy way to rescue exceptions that might be thrown by your Http library}
|
12
|
+
spec.description = %q{An easy way to rescue exceptions that might be thrown by your Http library}
|
13
|
+
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/http/exceptions.rb
CHANGED
@@ -4,22 +4,6 @@ require "http/exceptions/http_exception"
|
|
4
4
|
|
5
5
|
module Http
|
6
6
|
module Exceptions
|
7
|
-
EXCEPTIONS = [
|
8
|
-
SocketError,
|
9
|
-
Errno::ETIMEDOUT,
|
10
|
-
(Net.const_defined?(:ReadTimeout) ? Net::ReadTimeout : EOFError),
|
11
|
-
(Net.const_defined?(:OpenTimeout) ? Net::OpenTimeout : EOFError),
|
12
|
-
Net::ProtocolError,
|
13
|
-
Errno::ECONNREFUSED,
|
14
|
-
Errno::EHOSTDOWN,
|
15
|
-
Errno::ECONNRESET,
|
16
|
-
Errno::ENETUNREACH,
|
17
|
-
Errno::EHOSTUNREACH,
|
18
|
-
Errno::ECONNABORTED,
|
19
|
-
OpenSSL::SSL::SSLError,
|
20
|
-
EOFError,
|
21
|
-
].freeze
|
22
|
-
|
23
7
|
def self.wrap_exception
|
24
8
|
begin
|
25
9
|
yield
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-exceptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Mathieu
|
8
|
-
- Russell Smith
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2018-01-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
@@ -39,16 +38,16 @@ dependencies:
|
|
39
38
|
- - ">="
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: '0'
|
42
|
-
description: An easy way to rescue exceptions that might be thrown by your
|
41
|
+
description: An easy way to rescue exceptions that might be thrown by your Http library
|
43
42
|
email:
|
44
43
|
- simon.math@gmail.com
|
45
|
-
- russ@rainforestqa.com
|
46
44
|
executables: []
|
47
45
|
extensions: []
|
48
46
|
extra_rdoc_files: []
|
49
47
|
files:
|
50
48
|
- ".gitignore"
|
51
49
|
- ".rspec"
|
50
|
+
- ".rvmrc"
|
52
51
|
- ".travis.yml"
|
53
52
|
- Gemfile
|
54
53
|
- LICENSE.txt
|
@@ -62,7 +61,7 @@ files:
|
|
62
61
|
- spec/http/exceptions/configuration_spec.rb
|
63
62
|
- spec/http_exception_spec.rb
|
64
63
|
- spec/spec_helper.rb
|
65
|
-
homepage:
|
64
|
+
homepage: ''
|
66
65
|
licenses:
|
67
66
|
- MIT
|
68
67
|
metadata: {}
|
@@ -82,10 +81,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
81
|
version: '0'
|
83
82
|
requirements: []
|
84
83
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.5.
|
84
|
+
rubygems_version: 2.5.2
|
86
85
|
signing_key:
|
87
86
|
specification_version: 4
|
88
|
-
summary: An easy way to rescue exceptions that might be thrown by your
|
87
|
+
summary: An easy way to rescue exceptions that might be thrown by your Http library
|
89
88
|
test_files:
|
90
89
|
- spec/http/exceptions/configuration_spec.rb
|
91
90
|
- spec/http_exception_spec.rb
|