This commit is contained in:
Lili (Tlapka) 2024-10-05 22:08:47 +02:00
parent c22af69b2a
commit 477151f423
3 changed files with 18 additions and 18 deletions

View File

@ -62,7 +62,7 @@ def clear_redeem_queue():
)
db.commit()
except sqlite3.Error as e:
print("Error occured deleting redeem queue:", e.args[0])
print("Error occurred deleting redeem queue:", e.args[0])
return False
return True
@ -74,7 +74,7 @@ def refresh_counters():
db.execute("DELETE FROM counters")
db.commit()
except sqlite3.Error as e:
print("Error occured deleting old counters:", e.args[0])
print("Error occurred deleting old counters:", e.args[0])
return False
if insert_counters(db):
return True
@ -144,7 +144,7 @@ def reset_milestone(milestone):
db.commit()
return True
except sqlite3.Error as e:
current_app.logger.error(f"Error occured adding a milestone: {e.args[0]}")
current_app.logger.error(f"Error occurred adding a milestone: {e.args[0]}")
return False

View File

@ -8,7 +8,7 @@ def is_stream_live():
try:
r = requests.get(url)
except requests.exceptions.RequestException as e:
current_app.logger.error(f"Error occured checking if stream is live: {e.args[0]}")
current_app.logger.error(f"Error occurred checking if stream is live: {e.args[0]}")
return False
return r.json()["online"]
@ -19,10 +19,10 @@ def give_points_to_chat(db):
try:
r = requests.get(url, headers=headers)
except requests.exceptions.RequestException as e:
current_app.logger.error(f"Error occured getting users to give points to: {e.args[0]}")
current_app.logger.error(f"Error occurred getting users to give points to: {e.args[0]}")
return
if r.status_code != 200:
current_app.logger.error(f"Error occured when giving points: Response code not 200.")
current_app.logger.error(f"Error occurred when giving points: Response code not 200.")
current_app.logger.error(f"Response code received: {r.status_code}.")
current_app.logger.error(f"Check owncast instance url and access key.")
return
@ -37,10 +37,10 @@ def send_chat(message):
try:
r = requests.post(url, headers=headers, json={"body": message})
except requests.exceptions.RequestException as e:
current_app.logger.error(f"Error occured sending chat message: {e.args[0]}")
current_app.logger.error(f"Error occurred sending chat message: {e.args[0]}")
return
if r.status_code != 200:
current_app.logger.error(f"Error occured when sending chat: Response code not 200.")
current_app.logger.error(f"Error occurred when sending chat: Response code not 200.")
current_app.logger.error(f"Response code received: {r.status_code}.")
current_app.logger.error(f"Check owncast instance url and access key.")
return

View File

@ -16,7 +16,7 @@ def counter_exists(db, counter_name):
return False
return True
except Error as e:
current_app.logger.error(f"Error occured checking if counter exists: {e.args[0]}")
current_app.logger.error(f"Error occurred checking if counter exists: {e.args[0]}")
current_app.logger.error(f"For counter: {counter_name}")
@ -30,7 +30,7 @@ def add_to_counter(db, counter_name):
db.commit()
return True
except Error as e:
current_app.logger.error(f"Error occured adding to counter: {e.args[0]}")
current_app.logger.error(f"Error occurred adding to counter: {e.args[0]}")
current_app.logger.error(f"To counter: {counter_name}")
return False
@ -44,7 +44,7 @@ def add_to_redeem_queue(db, user_id, redeem_name, note=None):
db.commit()
return True
except Error as e:
current_app.logger.error(f"Error occured adding to redeem queue: {e.args[0]}")
current_app.logger.error(f"Error occurred adding to redeem queue: {e.args[0]}")
current_app.logger.error(f"To user: {user_id} with redeem: {redeem_name} with note: {note}")
return False
@ -74,7 +74,7 @@ def add_to_milestone(db, user_id, redeem_name, points_donated):
db.commit()
return True
except Error as e:
current_app.logger.error(f"Error occured updating milestone: {e.args[0]}")
current_app.logger.error(f"Error occurred updating milestone: {e.args[0]}")
return False
@ -92,7 +92,7 @@ def milestone_complete(db, redeem_name):
else:
return row[0]
except Error as e:
current_app.logger.error(f"Error occured checking if milestone is complete: {e.args[0]}")
current_app.logger.error(f"Error occurred checking if milestone is complete: {e.args[0]}")
def check_apply_milestone_completion(db, redeem_name):
@ -117,7 +117,7 @@ def check_apply_milestone_completion(db, redeem_name):
return True
return False
except Error as e:
current_app.logger.error(f"Error occured applying milestone completion: {e.args[0]}")
current_app.logger.error(f"Error occurred applying milestone completion: {e.args[0]}")
return False
@ -128,7 +128,7 @@ def all_milestones(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.error(f"Error occured selecting all milestones: {e.args[0]}")
current_app.logger.error(f"Error occurred selecting all milestones: {e.args[0]}")
def all_counters(db):
@ -138,7 +138,7 @@ def all_counters(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.error(f"Error occured selecting all counters: {e.args[0]}")
current_app.logger.error(f"Error occurred selecting all counters: {e.args[0]}")
def all_active_counters(db):
@ -183,7 +183,7 @@ def pretty_redeem_queue(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.error(f"Error occured selecting pretty redeem queue: {e.args[0]}")
current_app.logger.error(f"Error occurred selecting pretty redeem queue: {e.args[0]}")
def whole_redeem_queue(db):
@ -193,7 +193,7 @@ def whole_redeem_queue(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.error(f"Error occured selecting redeem queue: {e.args[0]}")
current_app.logger.error(f"Error occurred selecting redeem queue: {e.args[0]}")
def is_redeem_active(redeem_name):