Obey handler.raise_error in _ahandle_event_for_handler (#6001)

Obey `handler.raise_error` in `_ahandle_event_for_handler`

Exceptions for async callbacks were only logged as warnings, also when
`raise_error = True`

#### Who can review?

  @hwchase17

   @agola11
This commit is contained in:
Mark Pors 2023-06-11 18:49:26 +02:00 committed by GitHub
parent 2d038b57b2
commit b934677a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,6 +238,8 @@ async def _ahandle_event_for_handler(
else:
logger.warning(f"Error in {event_name} callback: {e}")
except Exception as e:
if handler.raise_error:
raise e
logger.warning(f"Error in {event_name} callback: {e}")