File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ module OpenTok
11
11
# The exception that gets thrown when an invalid api-key and/or secret is given.
12
12
class OpenTokException < RuntimeError
13
13
14
- def initialize ( code , message )
15
- @code = code
14
+ def initialize ( message )
16
15
@mesasge = message
17
16
end
18
17
@@ -29,11 +28,9 @@ def exceptions
29
28
# Generates the relevant exception instance based on the XML error data received
30
29
def from_error ( error )
31
30
child = error . get_elements ( 'Errors' ) [ 0 ] . get_elements ( 'error' ) [ 0 ]
32
- code = child . attributes [ 'code' ]
33
- exception = exceptions . find { |exc | exc . http_code == code }
34
31
exception ||= self
35
32
message = child . children . empty? ? '' : child . children [ 0 ] . attributes [ 'message' ]
36
- exception . new code , message
33
+ exception . new message
37
34
end
38
35
39
36
# To be overriden by subclasses
@@ -50,4 +47,4 @@ def self.http_code
50
47
end
51
48
end
52
49
53
- end
50
+ end
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ def fetch(path, params={})
44
44
end
45
45
46
46
rescue Net ::HTTPExceptions => e
47
- raise OpenTokException . new e . response . code , "Unable to create fufill request: #{ e } "
47
+ raise OpenTokException . new "Unable to create fufill request: #{ e } "
48
48
rescue NoMethodError => e
49
- raise OpenTokException . new e . response . code , "Unable to create a fufill request at this time: #{ e } "
49
+ raise OpenTokException . new "Unable to create a fufill request at this time: #{ e } "
50
50
end
51
51
52
52
private
You can’t perform that action at this time.
0 commit comments