Skip to content

Commit

Permalink
fix: log errors that happened on the validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheus-Aguilar committed Jun 25, 2024
1 parent aa19e5e commit 83da76e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions node/directives/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const validateAdminToken = async (
}> => {
const {
clients: { identity, lm },
vtex: { logger },
} = context

// check if has admin token and if it is valid
Expand All @@ -36,6 +37,10 @@ export const validateAdminToken = async (
}
} catch (err) {
// noop so we leave hasValidAdminToken as false
logger.warn({
message: 'Error validating admin token',
err,
})
}
}

Expand All @@ -50,6 +55,7 @@ export const validateApiToken = async (
}> => {
const {
clients: { identity },
vtex: { logger },
} = context

// check if has api token and if it is valid
Expand All @@ -74,6 +80,10 @@ export const validateApiToken = async (
}
} catch (err) {
// noop so we leave hasValidApiToken as false
logger.warn({
message: 'Error validating API token',
err,
})
}
}

Expand All @@ -90,6 +100,7 @@ export const validateStoreToken = async (
}> => {
const {
clients: { vtexId },
vtex: { logger },
} = context

// check if has store token and if it is valid
Expand Down Expand Up @@ -118,6 +129,10 @@ export const validateStoreToken = async (
}
} catch (err) {
// noop so we leave hasValidStoreToken as false
logger.warn({
message: 'Error validating store token:',
err,
})
}
}

Expand Down

0 comments on commit 83da76e

Please sign in to comment.