slackapi / python-slack-events-api

Slack Events API adapter for Python (Flask required)
https://api.slack.com/events
MIT License
343 stars 116 forks source link

Pyee expects an exception when emitting an error #30

Closed psykzz closed 6 years ago

psykzz commented 6 years ago

Description

Pyee expects an exception when emitting an error

What type of issue is this? (place an x in one of the [ ])

Requirements

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackeventsapi version: 1.1.0 python version: 3.6.1 OS version(s): ubuntu within docker

Steps to reproduce:

  1. Fail a verification token check

Expected result:

The correct exception to be thrown

Actual result:

An exception about throwing an incorrect exception.

Attachments:

10.x.x.x - - [27/Jun/2018 08:13:45] "POST /slack/events HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/slackeventsapi/server.py", line 63, in event
    self.emitter.emit('error', 'invalid verification token')
  File "/usr/local/lib/python3.6/site-packages/pyee/__init__.py", line 178, in emit
    raise args[0]
TypeError: exceptions must derive from BaseException