File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -91,16 +91,20 @@ def _post(self, url):
91
91
postdata ['key' ] = self .key
92
92
resp = requests .post (url , json = postdata )
93
93
if resp .status_code != 200 :
94
+ err_description = resp .headers .get ('x-quickchart-error' )
94
95
raise RuntimeError (
95
- 'Invalid response code from chart creation endpoint' )
96
+ 'Invalid response code from chart creation endpoint: %d%s'
97
+ % (resp .status_code , '\n %s' % err_description if err_description else '' )
98
+ )
96
99
return resp
97
100
101
+
98
102
def get_short_url (self ):
99
103
resp = self ._post ('%s/chart/create' % self .get_url_base ())
100
104
parsed = json .loads (resp .text )
101
105
if not parsed ['success' ]:
102
106
raise RuntimeError (
103
- 'Failure response status from chart creation endpoint ' )
107
+ 'Chart creation endpoint failed to create chart ' )
104
108
return parsed ['url' ]
105
109
106
110
def get_bytes (self ):
You can’t perform that action at this time.
0 commit comments