def METHOD_NAME(*args, catch=Exception, on_exception_emit=None):
    """This is a decorator for Slots where an exception in user code is caught,
    printed and a optional qtSignal with signature qtSignal(Exception, str) is
    emitted when that happens.
    Based on:
        https://stackoverflow.com/questions/18740884/preventing-pyqt-to-silence-exceptions-occurring-in-slots
    Args:
        args (arguments):  any valid types for the Slot.
        catch (Exception):  Type of the exception to catch.  Defaults to Exception.
        on_exception_emit (str):  name of a qtSignal to be emitted.
    """
    if len(args) == 0 or isinstance(args[0], types.FunctionType):
        args = []
    @Slot(*args)
    def slot_decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):  # pylint: disable=unused-argument
            try:
                func(*args)
            except catch as e:  # pylint: disable=invalid-name,broad-except
                message = traceback.format_exc()
                message += '\n\nERROR in call by Metal GUI (see traceback above)\n'\
                    + f"\n{' module   :':12s} {wrapper.__module__}" \
                    + f"\n{' function :':12s} {wrapper.__qualname__}" \
                    + f"\n{' err msg  :':12s} {e.__repr__()}"\
                    + f"\n{' args; kws:':12s} {args}; {kwargs}" \
                do_debug(message, name='error')
                if on_exception_emit is not None:
                    # args[0] is instance of bound signal
                    qt_signal = getattr(args[0], on_exception_emit)
                    qt_signal.emit(e, wrapper.__name__)
        return wrapper
    return slot_decorator