Skip to content

Commit

Permalink
sqlite: provide better message error for insert
Browse files Browse the repository at this point in the history
Github-ref: OfflineIMAP#488
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
  • Loading branch information
nicolas33 authored and michaelcoyote committed Jan 15, 2018
1 parent 4041d1f commit a3edb87
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions offlineimap/folder/LocalStatusSQLite.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,14 @@ def savemessage(self, uid, content, flags, rtime, mtime=0, labels=set()):
self.messagelist[uid] = {'uid': uid, 'flags': flags, 'time': rtime, 'mtime': mtime, 'labels': labels}
flags = ''.join(sorted(flags))
labels = ', '.join(sorted(labels))
self.__sql_write('INSERT INTO status (id,flags,mtime,labels) VALUES (?,?,?,?)',
(uid,flags,mtime,labels))
try:
self.__sql_write('INSERT INTO status (id,flags,mtime,labels) VALUES (?,?,?,?)',
(uid,flags,mtime,labels))
except Exception as e:
six.reraise(UserWarning,
UserWarning("%s while inserting UID %s"%
(str(e), str(uid))),
exc_info()[2])
return uid


Expand Down

0 comments on commit a3edb87

Please sign in to comment.