def METHOD_NAME(*args):
    if get_num_args(f) == 5 or args[2] is None:  # notification
        f(*args)
    else:  # call
        try:
            result = f(*args)
            if result:
                self.cli.hub.reply(
                    self.cli.get_private_key(),
                    args[2],
                    {"samp.status": SAMP_STATUS_ERROR, "samp.result": result},
                )
        except Exception:
            err = StringIO()
            traceback.print_exc(file=err)
            txt = err.getvalue()
            self.cli.hub.reply(
                self.cli.get_private_key(),
                args[2],
                {"samp.status": SAMP_STATUS_ERROR, "samp.result": {"txt": txt}},
            )