Ignore:
Timestamp:
07/16/13 21:02:24 (7 years ago)
Author:
ramonb
Message:

jobarchived/jobarchived.py:

  • changed XMLErrorHandler so that fatal error's are remembered for later use
  • exit daemon if fatal XML error occurs
  • see #170
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/jobarchived/jobarchived.py

    r925 r926  
    870870                xml.sax.parseString( my_data, self.myXMLHandler, self.myXMLError )
    871871
     872                if self.myXMLError.isFatal():
     873
     874                    sys.exit( 1 )
     875
    872876                debug_msg( 1, 'job_xml_thread(): Done parsing.' )
    873877            else:
     
    12511255class XMLErrorHandler( xml.sax.handler.ErrorHandler ):
    12521256
     1257    def __init__( self ):
     1258
     1259        self.me_fatal = False
     1260
    12531261    def error( self, exception ):
    12541262        """Recoverable error"""
     
    12631271        # Ignore 'no element found' errors
    12641272        if exception_str.find( 'no element found' ) != -1:
     1273
    12651274            debug_msg( 0, 'No XML data found: Socket not (re)connected or datasource not available.' )
    12661275            return 0
    12671276
     1277        self.me_fatal = True
     1278
    12681279        debug_msg( 0, 'FATAL ERROR: Non-recoverable XML error ' + str( exception ) )
    1269         sys.exit( 1 )
     1280
     1281    def isFatal( self ):
     1282
     1283        return self.me_fatal
    12701284
    12711285    def warning( self, exception ):
Note: See TracChangeset for help on using the changeset viewer.