[minor] replace 'raise e' with 'raise' for correct tracebacks

This commit is contained in:
Anand Doshi
2013-11-12 17:28:17 +05:30
parent 4f642e7670
commit 5f73a980b5
9 changed files with 12 additions and 12 deletions

View File

@@ -37,7 +37,7 @@ def update_file_list(doctype, singles):
except Exception, e:
print webnotes.getTraceback()
if (e.args and e.args[0]!=1054) or not e.args:
raise e
raise
def update_for_doc(doctype, doc):
for filedata in doc.file_list.split("\n"):

View File

@@ -10,4 +10,4 @@ def execute():
webnotes.conn.sql("""update `tab%s` set file_list =
replace(file_list, "-", "")""" % dt[0])
except Exception, e:
if e.args[0]!=1146: raise e
if e.args[0]!=1146: raise

View File

@@ -37,7 +37,7 @@ def execute():
except Exception, e:
# if duplicate entry, then dont update
if e[0]!=1062:
raise e
raise
changed_keys = change_map.keys()
@@ -62,5 +62,5 @@ def execute():
except Exception, e:
if e[0]!=1146:
raise e
raise

View File

@@ -25,4 +25,4 @@ def execute():
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
where ifnull(buying_or_selling, '')='' """)
else:
raise e
raise

View File

@@ -33,7 +33,7 @@ def execute():
pass
except Exception, e:
if e.args[0] != 1062:
raise e
raise
webnotes.delete_doc("DocType", "Question")
webnotes.delete_doc("DocType", "Answer")

View File

@@ -10,6 +10,6 @@ def execute():
webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")
webnotes.conn.commit()
except Exception, e:
if e.args[0]!=1061: raise e
if e.args[0]!=1061: raise
webnotes.conn.begin()

View File

@@ -19,4 +19,4 @@ def execute():
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
except MySQLdb.OperationalError, e:
if e.args[0] != 1054:
raise e
raise