use `except frappe.DoesNotExistError:`