os / slacker

Full-featured Python interface for the Slack API
Apache License 2.0
1.6k stars 245 forks source link

Empty file uploads leads to error #59

Closed skabbit closed 8 years ago

skabbit commented 8 years ago

When trying to upload an empty file (ex: error logs... in lucky cases), i'm getting error:

 File "/var/www/venv/local/lib/python2.7/site-packages/slacker/__init__.py", line 427, in upload
   files={'file': f})
 File "/var/www/venv/local/lib/python2.7/site-packages/slacker/__init__.py", line 70, in post
   return self._request(requests.post, api, **kwargs)
 File "/var/www/venv/local/lib/python2.7/site-packages/slacker/__init__.py", line 62, in _request
   raise Error(response.error)
Error: no_file

Just tried to put a symbol in file and error disappeared.

Thank you.

os commented 8 years ago

The error code relates to something at Slack's end and isn't related to the library so it would be up to you to choose how to handle it.