chore: rename exceptions

This commit is contained in:
Saqib 2021-10-19 18:01:18 +05:30 committed by GitHub
parent 4109caf1bf
commit b11c99137c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -161,11 +161,11 @@ class Database(object):
elif self.is_deadlocked(e):
err_msg = _('There was a problem accessing required resources to complete the transaction.') + '<br>'
err_msg += _('Please try again.')
frappe.throw(msg=err_msg, title=_('Deadlock Occurred'), exc=frappe.QueryDeadlock)
frappe.throw(msg=err_msg, title=_('Deadlock Occurred'), exc=frappe.QueryDeadlockError)
elif self.is_timedout(e):
err_msg = _('There was a problem accessing required resources to complete the transaction.') + '<br>'
err_msg += _('Please try again.')
frappe.throw(msg=err_msg, title=_('Request Timeout'), exc=frappe.QueryTimeout)
frappe.throw(msg=err_msg, title=_('Request Timeout'), exc=frappe.QueryTimeoutError)
if ignore_ddl and (self.is_missing_column(e) or self.is_missing_table(e) or self.cant_drop_field_or_key(e)):
pass

View file

@ -101,8 +101,8 @@ class DataTooLongException(ValidationError): pass
class FileAlreadyAttachedException(Exception): pass
class DocumentAlreadyRestored(Exception): pass
class AttachmentLimitReached(Exception): pass
class QueryTimeout(ValidationError): pass
class QueryDeadlock(ValidationError): pass
class QueryTimeoutError(ValidationError): pass
class QueryDeadlockError(ValidationError): pass
# OAuth exceptions
class InvalidAuthorizationHeader(CSRFTokenError): pass
class InvalidAuthorizationPrefix(CSRFTokenError): pass