def METHOD_NAME(error, reference: str = 'general'):
    """Log an plugin error."""
    from plugin import registry
    # make sure the registry is set up
    if reference not in registry.errors:
        registry.errors[reference] = []
    # add error to stack
    registry.errors[reference].append(error)