http2 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ GEM
8
8
  git (>= 1.2.5)
9
9
  rake
10
10
  rdoc
11
- json (1.7.3)
11
+ json (1.7.4)
12
12
  rake (0.9.2.2)
13
13
  rcov (0.9.11)
14
14
  rdoc (3.12)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{http2}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-07-24}
12
+ s.date = %q{2012-08-11}
13
13
  s.description = %q{A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
@@ -1,8 +1,12 @@
1
1
  #This class holds various classes for error-handeling.
2
2
  class Http2::Errors
3
3
  #Raised when trying to access something you dont have access to.
4
- class Noaccess < RuntimeError; end
4
+ class Noaccess < RuntimeError
5
+ attr_accessor :response
6
+ end
5
7
 
6
8
  #Raised when an internal error occurs on the servers side.
7
- class Internalserver < RuntimeError; end
9
+ class Internalserver < RuntimeError
10
+ attr_accessor :response
11
+ end
8
12
  end
@@ -531,9 +531,13 @@ class Http2
531
531
  return http.get(url)
532
532
  end
533
533
  elsif resp.args[:code].to_s == "500"
534
- raise Http2::Errors::Internalserver
534
+ err = Http2::Errors::Internalserver.new
535
+ err.response = resp
536
+ raise err
535
537
  elsif resp.args[:code].to_s == "403"
536
- raise Http2::Errors::Noaccess
538
+ err = Http2::Errors::Noaccess.new
539
+ err.response = resp
540
+ raise err
537
541
  else
538
542
  return resp
539
543
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: http2
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-07-24 00:00:00 +02:00
13
+ date: 2012-08-11 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- hash: -2734620261227702820
110
+ hash: 2447340270284784571
111
111
  segments:
112
112
  - 0
113
113
  version: "0"