Commit dfb9ba251c347b4a09618ecd1ffe850c196cdd79

Authored by pikidev ago
1 parent 6649eb491a
Exists in master

exception catch add

Showing 1 changed file with 13 additions and 4 deletions Side-by-side Diff

... ... @@ -117,11 +117,20 @@
117 117 sqlvalues = sqlvalues[:len(sqlvalues)-2] + ");"
118 118  
119 119 #print (sqlprefix + sqlvalues).encode("utf-8")
  120 + print "processing..." + p_id + "_" + c_id
  121 +
  122 + try:
  123 + datadb.fb_insert(sqlprefix + sqlvalues)
  124 + except Exception as e:
  125 + print "[insert error] " + (sqlprefix + sqlvalues).encode("utf-8")
  126 + print(e)
  127 +
  128 + try:
  129 + datadb.fb_insert(sqlreplace + sqlprefix[32:] + sqlvalues)
  130 + except Exception as e:
  131 + print "[replace error] " + (sqlreplace + sqlprefix[32:] + sqlvalues).encode("utf-8")
  132 + print(e)
120 133  
121   - datadb.fb_insert(sqlprefix + sqlvalues)
122   - datadb.fb_insert(sqlreplace + sqlprefix[32:] + sqlvalues)
123   -
124   - print p_id + " done"
125 134 del(datadb)
126 135 del(insight)