code: func (s *Session) exitErr(err error) {
  	s.shutdownLock.Lock()
  	if s.shutdownErr == nil {
  		s.shutdownErr = err
  	}
  	s.shutdownLock.Unlock()
  	s.Close()
  }
docs: // exitErr is used to handle an error that is causing the
  // session to terminate.