def METHOD_NAME(self):
    try:
        result = self.work()
        self.finished.emit(result)
    except UserAbortedNotification:
        self.finished.emit(None)
    except Exception as e:
        # forward the exception upstream
        self.error.emit(e)
        self.finished.emit(None)