File tree 2 files changed +16
-4
lines changed
Filter options
2 files changed +16
-4
lines changed
Original file line number Diff line number Diff line change 1
1
from core import Zencoder
2
+ from core import ZencoderResponseError
2
3
Original file line number Diff line number Diff line change 25
25
class ZencoderError (Exception ):
26
26
pass
27
27
28
+ class ZencoderResponseError (Exception ):
29
+ def __init__ (self , http_response , content ):
30
+ self .http_response = http_response
31
+ self .content = content
32
+
28
33
class HTTPBackend (object ):
29
34
"""
30
35
Abstracts out an HTTP backend, but defaults to httplib2
@@ -117,10 +122,16 @@ def process(self, http_response, content):
117
122
"""
118
123
Returns HTTP backend agnostic Response data
119
124
"""
120
- code = http_response .status
121
- body = self .decode (content )
122
- response = Response (code , body , content , http_response )
123
- return response
125
+
126
+ try :
127
+ code = http_response .status
128
+ body = self .decode (content )
129
+ response = Response (code , body , content , http_response )
130
+
131
+ return response
132
+
133
+ except ValueError as e :
134
+ raise ZencoderResponseError (http_response , content )
124
135
125
136
class Zencoder (object ):
126
137
""" This is the entry point to the Zencoder API """
You can’t perform that action at this time.
0 commit comments