File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ A Python client for the [quickchart.io](https://quickchart.io/) image charts web
77
88# Installation
99
10- Use the ` quickchart.py ` library in this project, or install through [ pip] ( https://pypi.org/project/quickchart.io/ ) :
10+ Use the ` quickchart ` library in this project, or install through [ pip] ( https://pypi.org/project/quickchart.io/ ) :
1111
1212```
1313pip install quickchart.io
Original file line number Diff line number Diff line change @@ -96,16 +96,20 @@ def _post(self, url):
9696 }
9797 resp = requests .post (url , json = postdata , headers = headers )
9898 if resp .status_code != 200 :
99+ err_description = resp .headers .get ('x-quickchart-error' )
99100 raise RuntimeError (
100- 'Invalid response code from chart creation endpoint' )
101+ 'Invalid response code from chart creation endpoint: %d%s'
102+ % (resp .status_code , '\n %s' % err_description if err_description else '' )
103+ )
101104 return resp
102105
106+
103107 def get_short_url (self ):
104108 resp = self ._post ('%s/chart/create' % self .get_url_base ())
105109 parsed = json .loads (resp .text )
106110 if not parsed ['success' ]:
107111 raise RuntimeError (
108- 'Failure response status from chart creation endpoint ' )
112+ 'Chart creation endpoint failed to create chart ' )
109113 return parsed ['url' ]
110114
111115 def get_bytes (self ):
You can’t perform that action at this time.
0 commit comments