cas_client 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,4 +16,7 @@ module CASClient
16
16
 
17
17
  class PasswordMismatch < StandardError
18
18
  end
19
+
20
+ class RequestError < StandardError
21
+ end
19
22
  end
@@ -140,7 +140,8 @@ module CASClient
140
140
  when Net::HTTPNotFound
141
141
  raise CASClient::UUIDNotFound
142
142
  when Net::HTTPForbidden
143
- case Yajl::Parser.new(:symbolize_keys => true).parse(res.body)[:errors].first
143
+ response_body = Yajl::Parser.new(:symbolize_keys => true).parse(res.body)
144
+ case response_body[:errors].first
144
145
  when "Email is required to reset password"
145
146
  raise CASClient::EmailMissing, "Email is required to reset password"
146
147
  when "Email has already been taken"
@@ -152,7 +153,7 @@ module CASClient
152
153
  when "Password doesn't match confirmation"
153
154
  raise CASClient::PasswordMismatch, "Password and confirmation do not match"
154
155
  else
155
- res.error!
156
+ raise CASClient::RequestError, response_body.inspect
156
157
  end
157
158
  else
158
159
  res.error!
@@ -1,3 +1,3 @@
1
1
  module CASClient
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cas_client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Moran
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-29 00:00:00 -07:00
18
+ date: 2011-07-01 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency