code: func (handle *ContextHandle) detectErrorCondition(currentSession mPkcs11.SessionHandle) error {
  	var e error
  	slot, ok := handle.findSlot(handle.ctx)
  	if !ok || slot != handle.slot {
  		e = errSlotIDChanged
  	}
  
  	if e == nil {
  		_, e = handle.ctx.GetSessionInfo(currentSession)
  		if e == nil {
  			_, e = handle.ctx.GetOperationState(currentSession)
  		}
  	}
  
  	return e
  }
docs: //detectErrorCondition checks if given session handle has errors