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