diff --git a/packages/lib/profile/src/userProfile/getUserProfile.ts b/packages/lib/profile/src/userProfile/getUserProfile.ts index f5978b89e..436900207 100644 --- a/packages/lib/profile/src/userProfile/getUserProfile.ts +++ b/packages/lib/profile/src/userProfile/getUserProfile.ts @@ -47,9 +47,9 @@ export async function getUserProfile( contact, PROFILE_RECORD_NAME, ); - //The user has no dm3-Profile text record set. Hence we need to fetch the profile offChain if (!textRecord) { - throw Error('Account has no dm3 profile'); + //The user has no dm3-Profile text record set. Hence we need to fetch the profile offChain + return undefined; } /** * The Text record can contain either diff --git a/packages/react/src/session/Connect.ts b/packages/react/src/session/Connect.ts index 296fd90fe..8e49a5280 100644 --- a/packages/react/src/session/Connect.ts +++ b/packages/react/src/session/Connect.ts @@ -4,7 +4,7 @@ import { checkUserProfile, getUserProfile, } from 'dm3-lib-profile'; -import { ethersHelper, globalConfig, log } from 'dm3-lib-shared'; +import { ethersHelper, globalConfig, log, logError } from 'dm3-lib-shared'; import { Connection, ConnectionState } from '../web3provider/Web3Provider'; import { getNameForAddress } from 'dm3-lib-offchain-resolver-api'; @@ -36,7 +36,7 @@ export async function connectEthAccount( ? await connectOnchainAccount(connection, ensName, address) : await connectOffchainAccount(connection, address); } catch (e) { - log('[connectEthAccount] ' + JSON.stringify(e), 'error'); + logError('[connectEthAccount] ' + e); return { existingAccount: false, connectionState: ConnectionState.ConnectionRejected,