<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_error(self, error_shortmsg: str, error_longmsg: str):
 """ Set the stage to error and add a message """

        LOG.error(f"Update session: error in stage {self._stage.name}: "
                  f"{error_shortmsg}: {error_longmsg}")
        self._error = Value(error_shortmsg, error_longmsg)
        self.set_stage(Stages.ERROR)