standardize log statements

This commit is contained in:
Alex Holliday committed 2024-10-24 15:28:13 +08:00
1 parent 6984eb8a70
commit a0248c81c2
12 files changed
+167 -115

No files matched your search

+3 -1
View File
@@ -10,8 +10,10 @@ const verifyOwnership = (Model, paramName) => {
const doc = await Model.findById(documentId);
//If the document is not found, return a 404 error
if (!doc) {
logger.error(errorMessages.VERIFY_OWNER_NOT_FOUND, {
logger.error({
message: errorMessages.VERIFY_OWNER_NOT_FOUND,
service: SERVICE_NAME,
method: "verifyOwnership",
});
const error = new Error(errorMessages.VERIFY_OWNER_NOT_FOUND);
error.status = 404;