rcicindela 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rcicindela.rb +10 -1
  2. metadata +1 -1
@@ -1,7 +1,7 @@
1
1
  require 'net/http'
2
2
 
3
3
  class RCicindela
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
 
6
6
  class APIError < StandardError
7
7
  attr_reader :response
@@ -11,6 +11,13 @@ class RCicindela
11
11
  end
12
12
  end
13
13
 
14
+ class TimeoutError < StandardError
15
+ attr_reader :error
16
+ def initialize(error, message = '')
17
+ @error = error
18
+ end
19
+ end
20
+
14
21
  attr_reader :host, :port, :base_path, :timeout, :default_params
15
22
 
16
23
  def initialize(host, options = {})
@@ -64,5 +71,7 @@ class RCicindela
64
71
  raise APIError.new(response)
65
72
  end
66
73
  end
74
+ rescue Timeout::Error => e
75
+ raise TimeoutError.new(e)
67
76
  end
68
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcicindela
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo