+

MantisWS : improve error log of add_note_to_issue() method and raise exception on unknown error

Benjamin Renard [2012-04-20 15:31:05]
MantisWS : improve error log of add_note_to_issue() method and raise exception on unknown error
Filename
src/usr/share/mantis-smtp/MantisWS.py
diff --git a/src/usr/share/mantis-smtp/MantisWS.py b/src/usr/share/mantis-smtp/MantisWS.py
index 4f1d5e0..25fd313 100755
--- a/src/usr/share/mantis-smtp/MantisWS.py
+++ b/src/usr/share/mantis-smtp/MantisWS.py
@@ -76,12 +76,13 @@ class MantisWS(object):
 			)
 			return res
 		except suds.WebFault, e:
-			logging.error('Problem adding attachment %s to issue %s : %s' % (attachment['filename'],issue_id,e))
+			logging.error('Problem adding attachment %s to issue %s' % (attachment['filename'],issue_id))
 			err=str(e)
 			if re.search('Duplicate filename',err):
 				raise MantisWSError('duplicate_attachment_filename','Duplicate attachment filename %s in issue %s' % (attachment['filename'],issue_id))
 		except:
 			logging.error('Problem adding attachment %s to issue %s' % (attachment['filename'],issue_id))
+			raise MantisWSError('general_attachment','Problem adding attachment %s to issue %s' % (attachment['filename'],issue_id))
 			return None

         def set_option(self,option,value):
ViewGit