From b11c99137c90bd59ffb0dc49c7be6cb8bb97fa7f Mon Sep 17 00:00:00 2001 From: Saqib Date: Tue, 19 Oct 2021 18:01:18 +0530 Subject: [PATCH] chore: rename exceptions --- frappe/database/database.py | 4 ++-- frappe/exceptions.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 1325ad166a..88c643540f 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -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.') + '
' 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.') + '
' 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 diff --git a/frappe/exceptions.py b/frappe/exceptions.py index 6c063127c2..81b4b2e24d 100644 --- a/frappe/exceptions.py +++ b/frappe/exceptions.py @@ -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