File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 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):
9191 postdata ['key' ] = self .key
9292 resp = requests .post (url , json = postdata )
9393 if resp .status_code != 200 :
94+ err_description = resp .headers .get ('x-quickchart-error' )
9495 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+ )
9699 return resp
97100
101+
98102 def get_short_url (self ):
99103 resp = self ._post ('%s/chart/create' % self .get_url_base ())
100104 parsed = json .loads (resp .text )
101105 if not parsed ['success' ]:
102106 raise RuntimeError (
103- 'Failure response status from chart creation endpoint ' )
107+ 'Chart creation endpoint failed to create chart ' )
104108 return parsed ['url' ]
105109
106110 def get_bytes (self ):
You can’t perform that action at this time.
0 commit comments