diff --git a/src/back/routes/user.ts b/src/back/routes/user.ts index 67f2dc6bc..751aee1c3 100644 --- a/src/back/routes/user.ts +++ b/src/back/routes/user.ts @@ -96,13 +96,13 @@ async function getProfile(req: Request) { const address = req.params.address validateAddress(address) - try { - const user = await UserModel.findOne({ address: address.toLowerCase() }) + const user = await UserModel.findOne({ address: address.toLowerCase() }) - if (!user) { - throw new RequestError('User not found', RequestError.NotFound) - } + if (!user) { + throw new RequestError('User not found', RequestError.NotFound) + } + try { const { forum_id } = user return { diff --git a/src/hooks/useProfile.ts b/src/hooks/useProfile.ts index 2f4c31280..b6b2263c6 100644 --- a/src/hooks/useProfile.ts +++ b/src/hooks/useProfile.ts @@ -1,9 +1,7 @@ import { useQuery } from '@tanstack/react-query' import isEthereumAddress from 'validator/lib/isEthereumAddress' -import { ErrorClient } from '../clients/ErrorClient' import { createDefaultAvatar, getProfile } from '../utils/Catalyst' -import { ErrorCategory } from '../utils/errorCategories' import { DEFAULT_QUERY_STALE_TIME } from './constants' @@ -15,7 +13,6 @@ export default function useProfile(address?: string | null) { const profile = await getProfile(address) return { profile: profile || createDefaultAvatar(address), isDefaultProfile: !profile } } catch (error) { - ErrorClient.report('Error getting profile', { error, address, category: ErrorCategory.Profile }) return null } }