FlipkartSeller 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e12d0ee02e00a4aefadc7ed8d48e771014c25ea6
4
- data.tar.gz: 7c8d31f329299dd12bf5a5d641323103c5b2f970
3
+ metadata.gz: 7716d42278546c5a9f8e1c00feab935e6bf3d19f
4
+ data.tar.gz: e05026b70d6319558e9280f1b54578fb77b143ed
5
5
  SHA512:
6
- metadata.gz: 6520d4f5c5005340f98bff4d150f7ba0817c1bbff0f17325c32546e3f72f2b7a1bd3802548784c800572c76756f52039b37961ce510a9c6a978475116c5bfcdf
7
- data.tar.gz: d423b82c7aaf19dbc1d9484fb334e4b2ef4593632b512c0ee377f6e7c697bb066994173edfd0e9715527822f92b71244853c9cb988dc14e7370570225ea9802b
6
+ metadata.gz: 04b05e08c25fbc24a3088ba0829ac3121bbf58792cdfbdfe0040ec299d0ec2a397810bf2766c5e731d19a8cd99e427a572d2130008343763865f1c3423e8791b
7
+ data.tar.gz: f17484b4f96ee50878a2c32965c7d138b1b52984768c163424b3d3186cb1d970da1c11ee8b3df08e2bbc3bcf09b83a260c7448d87c97dba794b9f91ebf49ac0e
@@ -1,17 +1,53 @@
1
1
  module FlipkartSeller
2
2
 
3
- class Exception < StandardError; end
3
+ class Exception < StandardError
4
+ attr_reader :response
4
5
 
5
- class BadRequest < Exception; end #for 400 response
6
+ def initialize(response)
7
+ @response = response
8
+ end
9
+ end
6
10
 
7
- class Forbidden < Exception; end #for 403 response
11
+ #for 400 response
12
+ class BadRequest < Exception
13
+ def initialize(response)
14
+ super(response)
15
+ end
16
+ end
8
17
 
9
- class NotFound < Exception; end #for 404 response
18
+ #for 403 response
19
+ class Forbidden < Exception
20
+ def initialize(response)
21
+ super(response)
22
+ end
23
+ end
10
24
 
11
- class InternalServerError < Exception; end # for 500 response
25
+ #for 404 response
26
+ class NotFound < Exception
27
+ def initialize(response)
28
+ super(response)
29
+ end
30
+ end
12
31
 
13
- class ServiceUnavailable < Exception; end # for 503 response
32
+ # for 500 response
33
+ class InternalServerError < Exception
34
+ def initialize(response)
35
+ super(response)
36
+ end
37
+ end
14
38
 
15
- class ConnectionTimedOut < Exception; end # for 599 response
39
+ # for 503 response
40
+ class ServiceUnavailable < Exception
41
+ def initialize(response)
42
+ super(response)
43
+ end
44
+ end
45
+
46
+ # for 599 response
47
+ class ConnectionTimedOut < Exception
48
+ def initialize(response)
49
+ super(response)
50
+ end
51
+ end
16
52
 
17
53
  end
@@ -18,22 +18,22 @@ module FlipkartSeller
18
18
 
19
19
  rescue RestClient::Unauthorized, RestClient::Forbidden => e
20
20
 
21
- raise Forbidden.new(e.response)
21
+ raise Forbidden.new(e.response), e.message
22
22
 
23
23
  rescue RestClient::ExceptionWithResponse => e
24
24
  case e.response.code
25
25
  when 400
26
- raise BadRequest.new(e.response)
26
+ raise BadRequest.new(e.response), e.message
27
27
  when 403
28
- raise Forbidden.new(e.response)
28
+ raise Forbidden.new(e.response), e.message
29
29
  when 404
30
- raise NotFound.new(e.response)
30
+ raise NotFound.new(e.response), e.message
31
31
  when 500
32
- raise InternalServerError.new(e.response)
32
+ raise InternalServerError.new(e.response), e.message
33
33
  when 503
34
- raise ServiceUnavailable.new(e.response)
34
+ raise ServiceUnavailable.new(e.response), e.message
35
35
  when 599
36
- raise ConnectionTimedOut.new(e.response)
36
+ raise ConnectionTimedOut.new(e.response), e.message
37
37
  end
38
38
  end
39
39
 
@@ -1,3 +1,3 @@
1
1
  module FlipkartSeller
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: FlipkartSeller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atish Kumar Sahoo