Skip to content

Commit

Permalink
Only grab url if the upload was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldemoura committed Dec 4, 2018
1 parent 9decd32 commit ee3d45b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/myazo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
data={'secret': config.get('secret')},
files={'screenshot': img}
)
url = r.text

if r.status_code != 200:
print('Error: Failed to upload screenshot. Server returned status code {}.'.format(r.status_code))
exit(-2)

url = r.text

if config.getboolean('open_browser'):
webbrowser.open(url)
if config.getboolean('copy_clipboard'):
Expand Down

0 comments on commit ee3d45b

Please sign in to comment.