mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
[minor] replace 'raise e' with 'raise' for correct tracebacks
This commit is contained in:
@@ -37,7 +37,7 @@ def update_file_list(doctype, singles):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
print webnotes.getTraceback()
|
print webnotes.getTraceback()
|
||||||
if (e.args and e.args[0]!=1054) or not e.args:
|
if (e.args and e.args[0]!=1054) or not e.args:
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
def update_for_doc(doctype, doc):
|
def update_for_doc(doctype, doc):
|
||||||
for filedata in doc.file_list.split("\n"):
|
for filedata in doc.file_list.split("\n"):
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ def execute():
|
|||||||
webnotes.conn.sql("""update `tab%s` set file_list =
|
webnotes.conn.sql("""update `tab%s` set file_list =
|
||||||
replace(file_list, "-", "")""" % dt[0])
|
replace(file_list, "-", "")""" % dt[0])
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if e.args[0]!=1146: raise e
|
if e.args[0]!=1146: raise
|
||||||
@@ -37,7 +37,7 @@ def execute():
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
# if duplicate entry, then dont update
|
# if duplicate entry, then dont update
|
||||||
if e[0]!=1062:
|
if e[0]!=1062:
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
|
|
||||||
changed_keys = change_map.keys()
|
changed_keys = change_map.keys()
|
||||||
@@ -62,5 +62,5 @@ def execute():
|
|||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if e[0]!=1146:
|
if e[0]!=1146:
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
@@ -25,4 +25,4 @@ def execute():
|
|||||||
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
|
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
|
||||||
where ifnull(buying_or_selling, '')='' """)
|
where ifnull(buying_or_selling, '')='' """)
|
||||||
else:
|
else:
|
||||||
raise e
|
raise
|
||||||
@@ -33,7 +33,7 @@ def execute():
|
|||||||
pass
|
pass
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if e.args[0] != 1062:
|
if e.args[0] != 1062:
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
webnotes.delete_doc("DocType", "Question")
|
webnotes.delete_doc("DocType", "Question")
|
||||||
webnotes.delete_doc("DocType", "Answer")
|
webnotes.delete_doc("DocType", "Answer")
|
||||||
|
|||||||
@@ -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.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if e.args[0]!=1061: raise e
|
if e.args[0]!=1061: raise
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ def execute():
|
|||||||
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
||||||
except MySQLdb.OperationalError, e:
|
except MySQLdb.OperationalError, e:
|
||||||
if e.args[0] != 1054:
|
if e.args[0] != 1054:
|
||||||
raise e
|
raise
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ def _make_customer(source_name, ignore_permissions=False):
|
|||||||
customer.insert()
|
customer.insert()
|
||||||
return customer
|
return customer
|
||||||
else:
|
else:
|
||||||
raise e
|
raise
|
||||||
except webnotes.MandatoryError:
|
except webnotes.MandatoryError:
|
||||||
from webnotes.utils import get_url_to_form
|
from webnotes.utils import get_url_to_form
|
||||||
webnotes.throw(_("Before proceeding, please create Customer from Lead") + \
|
webnotes.throw(_("Before proceeding, please create Customer from Lead") + \
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class DocType:
|
|||||||
inc_email.password = self.doc.support_password
|
inc_email.password = self.doc.support_password
|
||||||
except AttributeError, e:
|
except AttributeError, e:
|
||||||
webnotes.msgprint(err_msg)
|
webnotes.msgprint(err_msg)
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
pop_mb = POP3Mailbox(inc_email)
|
pop_mb = POP3Mailbox(inc_email)
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class DocType:
|
|||||||
except _socket.error, e:
|
except _socket.error, e:
|
||||||
# Invalid mail server -- due to refusing connection
|
# Invalid mail server -- due to refusing connection
|
||||||
webnotes.msgprint('Invalid POP3 Mail Server. Please rectify and try again.')
|
webnotes.msgprint('Invalid POP3 Mail Server. Please rectify and try again.')
|
||||||
raise e
|
raise
|
||||||
except poplib.error_proto, e:
|
except poplib.error_proto, e:
|
||||||
webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
|
webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
|
||||||
raise e
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user