openlibhums / consortial_billing

A plugin for Janeway for managing supporters.
GNU General Public License v3.0
0 stars 1 forks source link

Import error causes plugin to crash plugin list #23

Closed joemull closed 1 year ago

joemull commented 1 year ago

The same issue is happening as with the Back Content Plugin: https://github.com/BirkbeckCTP/back_content/issues/32

I don't know what import is causing it to fail this time. @ajrbyers could you document what's going on, since you knew how to fix the other one but it's kind of an opaque problem?

ajrbyers commented 1 year ago

So the plugin is crashing on load and its being handled, its likely an error on input. The error is handled here:

https://github.com/BirkbeckCTP/janeway/blob/9e979a496432b202cc53773b2280ca1d49f39617/src/core/include_urls.py#L245

On L246 the error message could be improved to something like:

logger.debug("Plugin {name} error: {error}".format(name=plugin.name, error=e))

When you run manage.py runserver any errors during plugin load will be output as debug statements in the console.

joemull commented 1 year ago

There is another bug that I will fix on this branch: base_name for Router.register is now deprecated that we use a newer version of the Django Rest Framework. See https://github.com/encode/django-rest-framework/pull/5990

joemull commented 1 year ago

Thanks for the explanation, Andy. I couldn't get this error to show again after I fixed the above one, but I have changed L246 as suggested in a PR coming soon.