<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _refresh_state(self):
 """ Get the state of a job. Must be overridden by derived Job classes for Jobs that don't use a Future. """

    if self._is_complete:
      return

    if not self._future:
      raise Exception('Please implement this in the derived class')

    if self._future.done():
      self._is_complete = True
      self._end_time = datetime.datetime.utcnow()
      try:
        self._result = self._future.result()
      except Exception as e:
        message = str(e)
        self._fatal_error = JobError(location=traceback.format_exc(), message=message,
                                     reason=str(type(e)))