fasttrack-client 1.0.1 → 1.0.2
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 +4 -4
- data/lib/exceptions.rb +33 -0
- data/lib/fasttrack-client.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69fccfa322e93742a531ab13e7ed2140d631dbbf
|
4
|
+
data.tar.gz: 8dd122fc9e236137977f861def62d94de96a7de0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0a3a3200567198b4278d930f6432238ce551022cc65ec69404c35bd2148e92cc6aa69ab89f67ef7ea7a73dffaa00faf5e304363cf8c02d9b043eb6a9ca3bb65
|
7
|
+
data.tar.gz: 3279ede144289cf98ed34f55244be10f98e45107eed10821997f253b1a3304f40afaf6b2c3cbab9f86ecc04ff9138da3dea86acf45b91890027139d0aa27bce9
|
data/lib/exceptions.rb
CHANGED
@@ -2,45 +2,78 @@
|
|
2
2
|
module FastTrack
|
3
3
|
# Bad parameters
|
4
4
|
class BadParametersException < Exception
|
5
|
+
def initialize(message = 'Send parameters through GET method')
|
6
|
+
super(message)
|
7
|
+
end
|
5
8
|
end
|
6
9
|
|
7
10
|
# Bad request
|
8
11
|
class BadRequestException < Exception
|
12
|
+
def initialize(message = 'Request is malformed')
|
13
|
+
super(message)
|
14
|
+
end
|
9
15
|
end
|
10
16
|
|
11
17
|
# Internal server error
|
12
18
|
class InternalServerException < Exception
|
19
|
+
def initialize(message = '')
|
20
|
+
super(message)
|
21
|
+
end
|
13
22
|
end
|
14
23
|
|
15
24
|
# Invalid version
|
16
25
|
class InvalidVersionException < Exception
|
26
|
+
def initialize(message = 'API version is invalid')
|
27
|
+
super(message)
|
28
|
+
end
|
17
29
|
end
|
18
30
|
|
19
31
|
# Method not allowed
|
20
32
|
class MethodNotAllowedException < Exception
|
33
|
+
def initialize(message = 'You tried to access an endpoint with an invalid method')
|
34
|
+
super(message)
|
35
|
+
end
|
21
36
|
end
|
22
37
|
|
23
38
|
# No result
|
24
39
|
class NoResultException < Exception
|
40
|
+
def initialize(message = 'No result matching your request')
|
41
|
+
super(message)
|
42
|
+
end
|
25
43
|
end
|
26
44
|
|
27
45
|
# Not acceptable
|
28
46
|
class NotAcceptableException < Exception
|
47
|
+
def initialize(message = 'You requested a format that is not json')
|
48
|
+
super(message)
|
49
|
+
end
|
29
50
|
end
|
30
51
|
|
31
52
|
# Not found
|
32
53
|
class NotFoundException < Exception
|
54
|
+
def initialize(message = 'Specified endpoint could not be found')
|
55
|
+
super(message)
|
56
|
+
end
|
33
57
|
end
|
34
58
|
|
35
59
|
# Too many requests
|
36
60
|
class TooManyRequestsException < Exception
|
61
|
+
def initialize(message = 'You made too many requests on the API in a short period of time')
|
62
|
+
super(message)
|
63
|
+
end
|
37
64
|
end
|
38
65
|
|
39
66
|
# Unauthorized
|
40
67
|
class UnauthorizedException < Exception
|
68
|
+
def initialize(message = 'API key is wrong')
|
69
|
+
super(message)
|
70
|
+
end
|
41
71
|
end
|
42
72
|
|
43
73
|
# Version required
|
44
74
|
class VersionRequiredException < Exception
|
75
|
+
def initialize(message = 'Send API version in the HTTP Accept headers')
|
76
|
+
super(message)
|
77
|
+
end
|
45
78
|
end
|
46
79
|
end
|
data/lib/fasttrack-client.rb
CHANGED