fix: add improved logging for contentstack requests
This commit is contained in:
@@ -67,7 +67,7 @@ export const accountPageQueryRouter = router({
|
||||
generateTags(lang, connections),
|
||||
generateTag(lang, validatedAccountPageRefs.data.account_page.system.uid),
|
||||
].flat()
|
||||
|
||||
console.info("contentstack.accountPage start ", { lang, uid })
|
||||
const response = await request<AccountPageDataRaw>(
|
||||
GetAccountPage,
|
||||
{
|
||||
@@ -78,6 +78,7 @@ export const accountPageQueryRouter = router({
|
||||
)
|
||||
|
||||
if (!response.data) {
|
||||
console.error("contentstack.accountPage not found error", { lang, uid })
|
||||
throw notFound(response)
|
||||
}
|
||||
|
||||
@@ -86,11 +87,13 @@ export const accountPageQueryRouter = router({
|
||||
)
|
||||
|
||||
if (!validatedAccountPage.success) {
|
||||
console.error(`Failed to validate Account Page - (uid: ${uid})`)
|
||||
console.error(validatedAccountPage.error)
|
||||
console.error(
|
||||
"contentstack.accountPage validation error",
|
||||
JSON.stringify(validatedAccountPage.error)
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
console.info("contentstack.accountPage success ", { lang, uid })
|
||||
// TODO: Make returned data nicer
|
||||
const content = validatedAccountPage.data.account_page.content.map(
|
||||
(block) => {
|
||||
|
||||
Reference in New Issue
Block a user