johnmaguire / Cardinal

A Python IRC bot, designed to make adding functionality quick and simple. (est. 2013)
MIT License
100 stars 38 forks source link

When registering a plugin's event callback fails, either rollback loading the plugin or still try to register other callbacks #144

Closed johnmaguire closed 4 years ago

johnmaguire commented 5 years ago

Currently, when attempting to register a plugin's callbacks defined via the @event decorator, if any callback fails (e.g. due to not having the right number of function arguments), any callbacks which haven't been registered yet will not be due to lack of exception handling inside the callback loop.

chrisfoose commented 5 years ago

Can I take a look at this?

johnmaguire commented 5 years ago

Sure @chrisfoose

I'm pretty sure we just need to add code in register() to look at the list of callbacks assigned to that event, log an error for each one we're removing, and remove ones from the list that don't properly match the arg count.

johnmaguire commented 4 years ago

Reopening & fixing so we have a test case for swapping event system in #165.