code: func (b *Backend) SetStateFailure(signature *tasks.Signature, err string) error {
  	taskState := tasks.NewFailureTaskState(signature, err)
  
  	if err := b.updateState(taskState); err != nil {
  		return err
  	}
  
  	if signature.GroupUUID == "" {
  		return nil
  	}
  
  	return b.markTaskCompleted(signature, taskState)
  }
docs: // SetStateFailure updates task state to FAILURE