parameters: (self, name, text=None, exc=None)
return_statement: return self
docstring: Send a stream-level error and close the connection.  Errors
          have this basic format:
  
              <stream:error>
                <{{ name }} xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
                <text xml:lang="en" "urn:ietf:params:xml:ns:xmpp-streams">
                  {{ text }}
                </text>
              </stream:error>
  
          See: <http://xmpp.org/rfcs/rfc3920.html#rfc.section.4.7.3>
docstring_summary: Send a stream-level error and close the connection.  Errors
          have this basic format:
docstring_tokens: Send a stream - level error and close the connection . Errors have this basic format :
function: def stream_error(self, name, text=None, exc=None):
          """Send a stream-level error and close the connection.  Errors
          have this basic format:
  
              <stream:error>
                <{{ name }} xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
                <text xml:lang="en" "urn:ietf:params:xml:ns:xmpp-streams">
                  {{ text }}
                </text>
              </stream:error>
  
          See: <http://xmpp.org/rfcs/rfc3920.html#rfc.section.4.7.3>
          """
  
          try:
              log.error('Stream Error: %s %r' % (name, text), exc_info=bool(exc))
              with self.state.clear().lock():
                  self.open_stream()
                  elem = self.E(self.ERROR, self.E(name, xmlns=self.ERROR_NS))
                  if text is not None:
                      elem.append(self.E.text(
                          { self.LANG: 'en', 'xmlns': self.ERROR_NS},
                          text
                      ))
                  self.write(elem).close()
          except:
              log.exception('Exception while reporting stream error.')
  
          return self
function_tokens: def stream_error ( self , name , text = None , exc = None ) : try : log . error ( 'Stream Error: %s %r' % ( name , text ) , exc_info = bool ( exc ) ) with self . state . clear ( ) . lock ( ) : self . open_stream ( ) elem = self . E ( self . ERROR , self . E ( name , xmlns = self . ERROR_NS ) ) if text is not None : elem . append ( self . E . text ( { self . LANG : 'en' , 'xmlns' : self . ERROR_NS } , text ) ) self . write ( elem ) . close ( ) except : log . exception ( 'Exception while reporting stream error.' ) return self