<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge(self, df: pd.DataFrame, on: str, how: str="outer", **kwargs):
 """ Set the main dataframe from the current dataframe and the passed dataframe :param df: the pandas dataframe to merge :type df: pd.DataFrame :param on: param for ``pd.merge`` :type on: str :param how: param for ``pd.merge``, defaults to "outer" :type how: str, optional :param kwargs: keyword arguments for ``pd.merge`` """

        try:
            df = pd.merge(self.df, df, on=on, how=how, **kwargs)
            self.df = df
        except Exception as e:
            self.err(e, self.merge, "Can not merge dataframes")