fix: log api response for profile data errors
This commit is contained in:
@@ -112,7 +112,6 @@ async function getVerifiedUser({ session }: { session: Session }) {
|
|||||||
"api.user.profile getVerifiedUser error",
|
"api.user.profile getVerifiedUser error",
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
error: {
|
error: {
|
||||||
token: session.token.access_token,
|
|
||||||
status: apiResponse.status,
|
status: apiResponse.status,
|
||||||
statusText: apiResponse.statusText,
|
statusText: apiResponse.statusText,
|
||||||
text,
|
text,
|
||||||
@@ -135,11 +134,15 @@ async function getVerifiedUser({ session }: { session: Session }) {
|
|||||||
|
|
||||||
const apiJson = await apiResponse.json()
|
const apiJson = await apiResponse.json()
|
||||||
if (!apiJson.data?.attributes) {
|
if (!apiJson.data?.attributes) {
|
||||||
getVerifiedUserFailCounter.add(1, { error_type: "data_error" })
|
getVerifiedUserFailCounter.add(1, {
|
||||||
|
error_type: "data_error",
|
||||||
|
})
|
||||||
console.error(
|
console.error(
|
||||||
"api.user.profile getVerifiedUser data error",
|
"api.user.profile getVerifiedUser data error",
|
||||||
JSON.stringify({})
|
JSON.stringify({
|
||||||
) // not passing the data to avoid logging sensitive data
|
apiResponse: apiJson,
|
||||||
|
})
|
||||||
|
)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user