discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] catching unrecognized exception


From: Nemanja Savic
Subject: [Discuss-gnuradio] catching unrecognized exception
Date: Mon, 3 Mar 2014 12:55:26 +0100

Hi all guys,

I have a block which is responsible to receive certain messages from other blocks and to write the data from the message into database. Sometimes the following exception occures and the block stops writing into database:

thread[thread-per-block[0]: <gr_block db_logger2 (62)>]: caught unrecognized exception

The structure of the block is really simple:

    def handle_msg(self, msg):
        message = pmt.pmt_symbol_to_string(msg)
        msg_lines = message.split('\n')
        try:
            sensor_id = msg_lines[0]
            vendor = msg_lines[2]
            sensor_type = msg_lines[3]
            time = msg_lines[1]
#try:
            querry = "INSERT INTO `%s`.`%s` (`id` ,`sens_id` ,`vendor`, `sensor_type`, `det_id`) VALUES (NULL , '%s', '%s', '%s','%s');" % (self._db_name, self._det_table, sensor_id, vendor, sensor_type, self._id)
#            print querry
            cur = self._con.cursor()
            cur.execute(querry)
        except mdb.Error, e:
            print "Unexpected error while trying to insert into table"
            print msg_lines
            print 50*'-'
            print "Error %d: %s" % (e.args[0],e.args[1])
            sys.exit(1)

Is there any way to track this problem and find the cause?

Best regards,

--
Nemanja Savić

reply via email to

[Prev in Thread] Current Thread [Next in Thread]