refactor: standardize error message in mariadb.service.ts

Updated logging messages in MariaDB service file. Removed template literals in logging and replaced them with standard strings for consistency and readability. Made adjustments in connection error messages and query execution error messages.
This commit is contained in:
Mathis H (Avnyr) 2024-05-24 11:23:03 +02:00
parent 8620ccb167
commit f4c74b129a
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -26,7 +26,7 @@ export class MariadbService {
}); });
this.Connection.connect((err) => { this.Connection.connect((err) => {
if (err) { if (err) {
this.logs.error(`Error connecting to MySQL:`, err); this.logs.error("Error connecting to MySQL:", err);
} }
this.logs.debug("Connected to MariaDB", this.envs.get("MYSQL_DATABASE")); this.logs.debug("Connected to MariaDB", this.envs.get("MYSQL_DATABASE"));
}); });
@ -39,7 +39,7 @@ export class MariadbService {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.Connection.query(queryString, (err, results) => { this.Connection.query(queryString, (err, results) => {
if (err) { if (err) {
this.logs.error(`Error executing query:`, err); this.logs.error("Error executing query:", err);
reject(err); reject(err);
} else { } else {
resolve(results); resolve(results);
@ -76,7 +76,7 @@ export class MariadbService {
`Action: ${data.actionName}`, `Action: ${data.actionName}`,
); );
if (_id.length > 0) { if (_id.length > 0) {
this.logs.trace(`Id post-pushed in factorized data.`, _id); this.logs.trace("Id post-pushed in factorized data.", _id);
values.push(_id); values.push(_id);
_sqlQueryKeys.push("id"); _sqlQueryKeys.push("id");
} }