mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
fix(minor): update frappe.error_log to new API (#30864)
* fix(minor): update frappe.error_log to new API * refactor: changes for updated log_error api Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -36,8 +36,7 @@ class Video(Document):
|
||||
self.comment_count = video_stats.get("commentCount")
|
||||
|
||||
except Exception:
|
||||
title = "Failed to Update YouTube Statistics for Video: {0}".format(self.name)
|
||||
frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
|
||||
self.log_error("Unable to update YouTube statistics")
|
||||
|
||||
|
||||
def is_tracking_enabled():
|
||||
@@ -109,8 +108,7 @@ def batch_update_youtube_data():
|
||||
video_stats = video.items
|
||||
return video_stats
|
||||
except Exception:
|
||||
title = "Failed to Update YouTube Statistics"
|
||||
frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
|
||||
frappe.log_error("Unable to update YouTube statistics")
|
||||
|
||||
def prepare_and_set_data(video_list):
|
||||
video_ids = get_formatted_ids(video_list)
|
||||
|
||||
@@ -18,5 +18,5 @@ class VideoSettings(Document):
|
||||
build("youtube", "v3", developerKey=self.api_key)
|
||||
except Exception:
|
||||
title = _("Failed to Authenticate the API key.")
|
||||
frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
|
||||
self.log_error("Failed to authenticate API key")
|
||||
frappe.throw(title + " Please check the error logs.", title=_("Invalid Credentials"))
|
||||
|
||||
Reference in New Issue
Block a user