def METHOD_NAME(self, step: Step, e: BaseException) -> None:
    # We don't do anything with uncacheable steps.
    if not step.cache_results:
        return
    try:
        step_info = self.step_info(step)
        if step_info.state != StepState.RUNNING:
            raise StepStateError(step, step_info.state)
        step_info.end_time = utc_now_datetime()
        step_info.error = exception_to_string(e)
        self._update_step_info(step_info)
    finally:
        self.locks.pop(step).release()