diff --git a/src/lib/hooks/useOTAUpdate.ts b/src/lib/hooks/useOTAUpdate.ts index 55147329..53eab300 100644 --- a/src/lib/hooks/useOTAUpdate.ts +++ b/src/lib/hooks/useOTAUpdate.ts @@ -36,7 +36,7 @@ export function useOTAUpdate() { showUpdatePopup() } catch (e) { logger.error('useOTAUpdate: Error while checking for update', { - error: e, + message: e, }) } }, [showUpdatePopup]) diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 342839a7..62d0bfc4 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -40,7 +40,7 @@ export async function requestPermissionsAndRegisterToken( logger.DebugContext.notifications, ) } catch (error) { - logger.error('Notifications: Failed to set push token', {error}) + logger.error('Notifications: Failed to set push token', {message: error}) } } @@ -71,7 +71,7 @@ export function registerTokenChangeHandler( logger.DebugContext.notifications, ) } catch (error) { - logger.error('Notifications: Failed to set push token', {error}) + logger.error('Notifications: Failed to set push token', {message: error}) } }) return () => { diff --git a/src/state/models/media/image.ts b/src/state/models/media/image.ts index 6a226484..5c547c14 100644 --- a/src/state/models/media/image.ts +++ b/src/state/models/media/image.ts @@ -186,7 +186,7 @@ export class ImageModel implements Omit { this.cropped = cropped }) } catch (err) { - logger.error('Failed to crop photo', {error: err}) + logger.error('Failed to crop photo', {message: err}) } } diff --git a/src/state/persisted/__tests__/migrate.test.ts b/src/state/persisted/__tests__/migrate.test.ts index 2435ed24..e4b55d5d 100644 --- a/src/state/persisted/__tests__/migrate.test.ts +++ b/src/state/persisted/__tests__/migrate.test.ts @@ -88,6 +88,6 @@ test('migrate: has legacy data, fails validation', async () => { expect(logger.error).toHaveBeenCalledWith( 'persisted state: legacy data failed validation', // @ts-ignore - {error: validate.error}, + {message: validate.error}, ) }) diff --git a/src/state/persisted/index.ts b/src/state/persisted/index.ts index 67d8b78c..2f34c2db 100644 --- a/src/state/persisted/index.ts +++ b/src/state/persisted/index.ts @@ -34,7 +34,7 @@ export async function init() { logger.log('persisted state: initialized') } catch (e) { logger.error('persisted state: failed to load root state from storage', { - error: e, + message: e, }) // AsyncStorage failure, but we can still continue in memory return defaults @@ -59,7 +59,7 @@ export async function write( }) } catch (e) { logger.error(`persisted state: failed writing root state to storage`, { - error: e, + message: e, }) } } @@ -89,7 +89,7 @@ async function onBroadcastMessage({data}: MessageEvent) { logger.error( `persisted state: failed handling update from broadcast channel`, { - error: e, + message: e, }, ) } diff --git a/src/state/persisted/legacy.ts b/src/state/persisted/legacy.ts index 097d6bc5..6bb75ae8 100644 --- a/src/state/persisted/legacy.ts +++ b/src/state/persisted/legacy.ts @@ -127,34 +127,6 @@ export async function migrate() { const newData = await read() const alreadyMigrated = Boolean(newData) - /* TODO BEGIN DEBUG — remove this eventually */ - try { - if (rawLegacyData) { - const legacy = JSON.parse(rawLegacyData) as Partial - logger.info(`persisted state: debug legacy data`, { - hasExistingLoggedInAccount: Boolean(legacy?.session?.data), - numberOfExistingAccounts: legacy?.session?.accounts?.length, - foundExistingCurrentAccount: Boolean( - legacy.session?.accounts?.find( - a => a.did === legacy.session?.data?.did, - ), - ), - }) - logger.info(`persisted state: debug new data`, { - hasNewData: Boolean(newData), - hasExistingLoggedInAccount: Boolean(newData?.session?.currentAccount), - numberOfExistingAccounts: newData?.session?.accounts?.length, - existingAccountMatchesLegacy: Boolean( - newData?.session?.currentAccount?.did === - legacy?.session?.data?.did, - ), - }) - } - } catch (e: any) { - logger.error(e, {message: `persisted state: legacy debugging failed`}) - } - /* TODO END DEBUG */ - if (!alreadyMigrated && rawLegacyData) { logger.info('persisted state: migrating legacy storage') @@ -167,7 +139,7 @@ export async function migrate() { logger.info('persisted state: migrated legacy storage') } else { logger.error('persisted state: legacy data failed validation', { - error: validate.error, + message: validate.error, }) } } else { @@ -185,7 +157,7 @@ export async function clearLegacyStorage() { await AsyncStorage.removeItem(DEPRECATED_ROOT_STATE_STORAGE_KEY) } catch (e: any) { logger.error(`persisted legacy store: failed to clear`, { - error: e.toString(), + message: e.toString(), }) } } diff --git a/src/state/persisted/store.ts b/src/state/persisted/store.ts index 04858fe5..bb7fbed8 100644 --- a/src/state/persisted/store.ts +++ b/src/state/persisted/store.ts @@ -22,6 +22,6 @@ export async function clear() { try { await AsyncStorage.removeItem(BSKY_STORAGE) } catch (e: any) { - logger.error(`persisted store: failed to clear`, {error: e.toString()}) + logger.error(`persisted store: failed to clear`, {message: e.toString()}) } } diff --git a/src/state/queries/actor-autocomplete.ts b/src/state/queries/actor-autocomplete.ts index ba9f9700..f55424c9 100644 --- a/src/state/queries/actor-autocomplete.ts +++ b/src/state/queries/actor-autocomplete.ts @@ -75,7 +75,7 @@ export function useActorAutocompleteFn() { }) } catch (e) { logger.error('useActorSearch: searchActorsTypeahead failed', { - error: e, + message: e, }) } } diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx index 629aff6d..ed2e6fcf 100644 --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -138,9 +138,6 @@ function createPersistSessionHandler( logger.info(`session: persistSession`, { event, - did: refreshedAccount.did, - handle: refreshedAccount.handle, - service: refreshedAccount.service, deactivated: refreshedAccount.deactivated, }) @@ -217,10 +214,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { verificationPhone, verificationCode, }: any) => { - logger.info(`session: creating account`, { - service, - handle, - }) + logger.info(`session: creating account`) track('Try Create Account') const agent = new BskyAgent({service}) @@ -272,14 +266,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { queryClient.clear() upsertAccount(account) - logger.debug( - `session: created account`, - { - service, - handle, - }, - logger.DebugContext.session, - ) + logger.debug(`session: created account`, {}, logger.DebugContext.session) track('Create Account') }, [upsertAccount, queryClient, clearCurrentAccount], @@ -287,14 +274,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const login = React.useCallback( async ({service, identifier, password}) => { - logger.debug( - `session: login`, - { - service, - identifier, - }, - logger.DebugContext.session, - ) + logger.debug(`session: login`, {}, logger.DebugContext.session) const agent = new BskyAgent({service}) @@ -329,14 +309,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { queryClient.clear() upsertAccount(account) - logger.debug( - `session: logged in`, - { - service, - identifier, - }, - logger.DebugContext.session, - ) + logger.debug(`session: logged in`, {}, logger.DebugContext.session) track('Sign In', {resumedSession: false}) }, @@ -360,14 +333,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const initSession = React.useCallback( async account => { - logger.debug( - `session: initSession`, - { - did: account.did, - handle: account.handle, - }, - logger.DebugContext.session, - ) + logger.debug(`session: initSession`, {}, logger.DebugContext.session) const agent = new BskyAgent({ service: account.service, @@ -435,7 +401,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { * we handle that failure via `createPersistSessionHandler` */ logger.info(`session: resumeSessionWithFreshAccount failed`, { - error: e, + message: e, }) __globalAgent = PUBLIC_BSKY_AGENT @@ -454,7 +420,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { * we handle that failure via `createPersistSessionHandler` */ logger.info(`session: resumeSessionWithFreshAccount failed`, { - error: e, + message: e, }) __globalAgent = PUBLIC_BSKY_AGENT @@ -497,7 +463,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { await initSession(account) } } catch (e) { - logger.error(`session: resumeSession failed`, {error: e}) + logger.error(`session: resumeSession failed`, {message: e}) } finally { setState(s => ({ ...s, @@ -613,10 +579,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { } else if (!session.currentAccount && state.currentAccount) { logger.debug( `session: persisted onUpdate, logging out`, - { - did: state.currentAccount?.did, - handle: state.currentAccount?.handle, - }, + {}, logger.DebugContext.session, ) diff --git a/src/view/com/auth/create/state.ts b/src/view/com/auth/create/state.ts index 81cebc11..e8a7cd4e 100644 --- a/src/view/com/auth/create/state.ts +++ b/src/view/com/auth/create/state.ts @@ -119,7 +119,7 @@ export async function requestVerificationCode({ } catch (e: any) { logger.error( `Failed to request sms verification code (${e.status} status)`, - {error: e}, + {message: e}, ) uiDispatch({type: 'set-error', value: cleanError(e.toString())}) } @@ -204,9 +204,11 @@ export async function submit({ } if ([400, 429].includes(e.status)) { - logger.warn('Failed to create account', {error: e}) + logger.warn('Failed to create account', {message: e}) } else { - logger.error(`Failed to create account (${e.status} status)`, {error: e}) + logger.error(`Failed to create account (${e.status} status)`, { + message: e, + }) } uiDispatch({type: 'set-processing', value: false}) diff --git a/src/view/com/auth/onboarding/RecommendedFeedsItem.tsx b/src/view/com/auth/onboarding/RecommendedFeedsItem.tsx index 63fb0ec1..ea3e1f72 100644 --- a/src/view/com/auth/onboarding/RecommendedFeedsItem.tsx +++ b/src/view/com/auth/onboarding/RecommendedFeedsItem.tsx @@ -55,7 +55,7 @@ export function RecommendedFeedsItem({ resetRemoveFeed() } catch (e) { Toast.show(_(msg`There was an issue contacting your server`)) - logger.error('Failed to unsave feed', {error: e}) + logger.error('Failed to unsave feed', {message: e}) } } else { try { @@ -64,7 +64,7 @@ export function RecommendedFeedsItem({ track('Onboarding:CustomFeedAdded') } catch (e) { Toast.show(_(msg`There was an issue contacting your server`)) - logger.error('Failed to pin feed', {error: e}) + logger.error('Failed to pin feed', {message: e}) } } } diff --git a/src/view/com/auth/onboarding/RecommendedFollows.tsx b/src/view/com/auth/onboarding/RecommendedFollows.tsx index 93cfb738..d275f6c9 100644 --- a/src/view/com/auth/onboarding/RecommendedFollows.tsx +++ b/src/view/com/auth/onboarding/RecommendedFollows.tsx @@ -135,7 +135,7 @@ export function RecommendedFollows({next}: Props) { } } catch (e) { logger.error('RecommendedFollows: failed to get suggestions', { - error: e, + message: e, }) } } diff --git a/src/view/com/auth/onboarding/RecommendedFollowsItem.tsx b/src/view/com/auth/onboarding/RecommendedFollowsItem.tsx index 93c515f3..07001068 100644 --- a/src/view/com/auth/onboarding/RecommendedFollowsItem.tsx +++ b/src/view/com/auth/onboarding/RecommendedFollowsItem.tsx @@ -88,7 +88,7 @@ export function ProfileCard({ } catch (e: any) { if (e?.name !== 'AbortError') { logger.error('RecommendedFollows: failed to toggle following', { - error: e, + message: e, }) } } finally { diff --git a/src/view/com/composer/useExternalLinkFetch.ts b/src/view/com/composer/useExternalLinkFetch.ts index fc7218d5..54773d56 100644 --- a/src/view/com/composer/useExternalLinkFetch.ts +++ b/src/view/com/composer/useExternalLinkFetch.ts @@ -51,7 +51,7 @@ export function useExternalLinkFetch({ }, err => { logger.error('Failed to fetch post for quote embedding', { - error: err.toString(), + message: err.toString(), }) setExtLink(undefined) }, @@ -70,7 +70,7 @@ export function useExternalLinkFetch({ }) }, err => { - logger.error('Failed to fetch feed for embedding', {error: err}) + logger.error('Failed to fetch feed for embedding', {message: err}) setExtLink(undefined) }, ) @@ -88,7 +88,7 @@ export function useExternalLinkFetch({ }) }, err => { - logger.error('Failed to fetch list for embedding', {error: err}) + logger.error('Failed to fetch list for embedding', {message: err}) setExtLink(undefined) }, ) diff --git a/src/view/com/feeds/FeedSourceCard.tsx b/src/view/com/feeds/FeedSourceCard.tsx index 48716384..0de88b24 100644 --- a/src/view/com/feeds/FeedSourceCard.tsx +++ b/src/view/com/feeds/FeedSourceCard.tsx @@ -111,7 +111,7 @@ export function FeedSourceCardLoaded({ Toast.show(_(msg`Removed from my feeds`)) } catch (e) { Toast.show(_(msg`There was an issue contacting your server`)) - logger.error('Failed to unsave feed', {error: e}) + logger.error('Failed to unsave feed', {message: e}) } }, }) @@ -125,7 +125,7 @@ export function FeedSourceCardLoaded({ Toast.show(_(msg`Added to my feeds`)) } catch (e) { Toast.show(_(msg`There was an issue contacting your server`)) - logger.error('Failed to save feed', {error: e}) + logger.error('Failed to save feed', {message: e}) } } }, [isSaved, openModal, feed, removeFeed, saveFeed, _, pinOnSave, pinFeed]) @@ -180,7 +180,7 @@ export function FeedSourceCardLoaded({ Toast.show( _(msg`There was an issue contacting your server`), ) - logger.error('Failed to unsave feed', {error: e}) + logger.error('Failed to unsave feed', {message: e}) } }, }) diff --git a/src/view/com/feeds/ProfileFeedgens.tsx b/src/view/com/feeds/ProfileFeedgens.tsx index f558eb18..96a04bad 100644 --- a/src/view/com/feeds/ProfileFeedgens.tsx +++ b/src/view/com/feeds/ProfileFeedgens.tsx @@ -103,7 +103,7 @@ export const ProfileFeedgens = React.forwardRef< try { await refetch() } catch (err) { - logger.error('Failed to refresh feeds', {error: err}) + logger.error('Failed to refresh feeds', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -114,7 +114,7 @@ export const ProfileFeedgens = React.forwardRef< try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more feeds', {error: err}) + logger.error('Failed to load more feeds', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/com/lists/ListMembers.tsx b/src/view/com/lists/ListMembers.tsx index 212244cd..4f2b5642 100644 --- a/src/view/com/lists/ListMembers.tsx +++ b/src/view/com/lists/ListMembers.tsx @@ -103,7 +103,7 @@ export function ListMembers({ try { await refetch() } catch (err) { - logger.error('Failed to refresh lists', {error: err}) + logger.error('Failed to refresh lists', {message: err}) } setIsRefreshing(false) }, [refetch, track, setIsRefreshing]) @@ -114,7 +114,7 @@ export function ListMembers({ try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more lists', {error: err}) + logger.error('Failed to load more lists', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage, track]) diff --git a/src/view/com/lists/MyLists.tsx b/src/view/com/lists/MyLists.tsx index a2a6b065..e9d2e4f0 100644 --- a/src/view/com/lists/MyLists.tsx +++ b/src/view/com/lists/MyLists.tsx @@ -69,7 +69,7 @@ export function MyLists({ try { await refetch() } catch (err) { - logger.error('Failed to refresh lists', {error: err}) + logger.error('Failed to refresh lists', {message: err}) } setIsPTRing(false) }, [refetch, track, setIsPTRing]) diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx index 89d6ab48..ba3e95b5 100644 --- a/src/view/com/lists/ProfileLists.tsx +++ b/src/view/com/lists/ProfileLists.tsx @@ -106,7 +106,7 @@ export const ProfileLists = React.forwardRef( try { await refetch() } catch (err) { - logger.error('Failed to refresh lists', {error: err}) + logger.error('Failed to refresh lists', {message: err}) } setIsPTRing(false) }, [refetch, track, setIsPTRing]) @@ -118,7 +118,7 @@ export const ProfileLists = React.forwardRef( try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more lists', {error: err}) + logger.error('Failed to load more lists', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage, track]) diff --git a/src/view/com/modals/AddAppPasswords.tsx b/src/view/com/modals/AddAppPasswords.tsx index 7ec8268b..5048a004 100644 --- a/src/view/com/modals/AddAppPasswords.tsx +++ b/src/view/com/modals/AddAppPasswords.tsx @@ -116,7 +116,7 @@ export function Component({}: {}) { } } catch (e) { Toast.show(_(msg`Failed to create app password.`), 'times') - logger.error('Failed to create app password', {error: e}) + logger.error('Failed to create app password', {message: e}) } } diff --git a/src/view/com/modals/BirthDateSettings.tsx b/src/view/com/modals/BirthDateSettings.tsx index 5ebc6113..1cab9598 100644 --- a/src/view/com/modals/BirthDateSettings.tsx +++ b/src/view/com/modals/BirthDateSettings.tsx @@ -43,7 +43,7 @@ function Inner({preferences}: {preferences: UsePreferencesQueryResponse}) { await setBirthDate({birthDate: date}) closeModal() } catch (e) { - logger.error(`setBirthDate failed`, {error: e}) + logger.error(`setBirthDate failed`, {message: e}) } }, [date, setBirthDate, closeModal]) diff --git a/src/view/com/modals/ChangeHandle.tsx b/src/view/com/modals/ChangeHandle.tsx index e578fa7d..a43c30c2 100644 --- a/src/view/com/modals/ChangeHandle.tsx +++ b/src/view/com/modals/ChangeHandle.tsx @@ -121,7 +121,7 @@ export function Inner({ onChanged() } catch (err: any) { setError(cleanError(err)) - logger.error('Failed to update handle', {handle, error: err}) + logger.error('Failed to update handle', {handle, message: err}) } finally { } }, [ diff --git a/src/view/com/modals/ContentFilteringSettings.tsx b/src/view/com/modals/ContentFilteringSettings.tsx index d681fbf0..21e03c56 100644 --- a/src/view/com/modals/ContentFilteringSettings.tsx +++ b/src/view/com/modals/ContentFilteringSettings.tsx @@ -125,7 +125,7 @@ function AdultContentEnabledPref() { Toast.show( _(msg`There was an issue syncing your preferences with the server`), ) - logger.error('Failed to update preferences with server', {error: e}) + logger.error('Failed to update preferences with server', {message: e}) } }, [variables, preferences, mutate, _]) diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index dd8ac9ae..097b7b0d 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -129,7 +129,7 @@ export function Component({ onUpdate?.() closeModal() } catch (e: any) { - logger.error('Failed to update user profile', {error: String(e)}) + logger.error('Failed to update user profile', {message: String(e)}) } }, [ track, diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx index 2088acba..015aaaa2 100644 --- a/src/view/com/notifications/Feed.tsx +++ b/src/view/com/notifications/Feed.tsx @@ -73,7 +73,7 @@ export function Feed({ await checkUnread({invalidate: true}) } catch (err) { logger.error('Failed to refresh notifications feed', { - error: err, + message: err, }) } finally { setIsPTRing(false) @@ -86,7 +86,7 @@ export function Feed({ try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more notifications', {error: err}) + logger.error('Failed to load more notifications', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/com/post-thread/PostLikedBy.tsx b/src/view/com/post-thread/PostLikedBy.tsx index 58208916..55463dc1 100644 --- a/src/view/com/post-thread/PostLikedBy.tsx +++ b/src/view/com/post-thread/PostLikedBy.tsx @@ -40,7 +40,7 @@ export function PostLikedBy({uri}: {uri: string}) { try { await refetch() } catch (err) { - logger.error('Failed to refresh likes', {error: err}) + logger.error('Failed to refresh likes', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -50,7 +50,7 @@ export function PostLikedBy({uri}: {uri: string}) { try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more likes', {error: err}) + logger.error('Failed to load more likes', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/com/post-thread/PostRepostedBy.tsx b/src/view/com/post-thread/PostRepostedBy.tsx index 7bbd8aa6..31a0be83 100644 --- a/src/view/com/post-thread/PostRepostedBy.tsx +++ b/src/view/com/post-thread/PostRepostedBy.tsx @@ -40,7 +40,7 @@ export function PostRepostedBy({uri}: {uri: string}) { try { await refetch() } catch (err) { - logger.error('Failed to refresh reposts', {error: err}) + logger.error('Failed to refresh reposts', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -50,7 +50,7 @@ export function PostRepostedBy({uri}: {uri: string}) { try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more reposts', {error: err}) + logger.error('Failed to load more reposts', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index cace5c38..ef3d7e2b 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -238,7 +238,7 @@ function PostThreadLoaded({ try { await onRefresh() } catch (err) { - logger.error('Failed to refresh posts thread', {error: err}) + logger.error('Failed to refresh posts thread', {message: err}) } setIsPTRing(false) }, [setIsPTRing, onRefresh]) diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index 04753fe6..54d8aa22 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -120,7 +120,7 @@ let Feed = ({ onHasNew(true) } } catch (e) { - logger.error('Poll latest failed', {feed, error: String(e)}) + logger.error('Poll latest failed', {feed, message: String(e)}) } }, [feed, data, isFetching, onHasNew, enabled, disablePoll]) @@ -216,7 +216,7 @@ let Feed = ({ await refetch() onHasNew?.(false) } catch (err) { - logger.error('Failed to refresh posts feed', {error: err}) + logger.error('Failed to refresh posts feed', {message: err}) } setIsPTRing(false) }, [refetch, track, setIsPTRing, onHasNew]) @@ -228,7 +228,7 @@ let Feed = ({ try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more posts', {error: err}) + logger.error('Failed to load more posts', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage, track]) diff --git a/src/view/com/posts/FeedErrorMessage.tsx b/src/view/com/posts/FeedErrorMessage.tsx index 48ed49bb..6d99c32f 100644 --- a/src/view/com/posts/FeedErrorMessage.tsx +++ b/src/view/com/posts/FeedErrorMessage.tsx @@ -139,7 +139,7 @@ function FeedgenErrorMessage({ msgLingui`There was an an issue removing this feed. Please check your internet connection and try again.`, ), ) - logger.error('Failed to remove feed', {error: err}) + logger.error('Failed to remove feed', {message: err}) } }, onPressCancel() { diff --git a/src/view/com/profile/ProfileFollowers.tsx b/src/view/com/profile/ProfileFollowers.tsx index 87d519ed..411ae6c1 100644 --- a/src/view/com/profile/ProfileFollowers.tsx +++ b/src/view/com/profile/ProfileFollowers.tsx @@ -41,7 +41,7 @@ export function ProfileFollowers({name}: {name: string}) { try { await refetch() } catch (err) { - logger.error('Failed to refresh followers', {error: err}) + logger.error('Failed to refresh followers', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -51,7 +51,7 @@ export function ProfileFollowers({name}: {name: string}) { try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more followers', {error: err}) + logger.error('Failed to load more followers', {message: err}) } } diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index d831ad77..0305dc26 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -200,7 +200,7 @@ let ProfileHeaderLoaded = ({ ) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to follow', {error: String(e)}) + logger.error('Failed to follow', {message: String(e)}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } @@ -221,7 +221,7 @@ let ProfileHeaderLoaded = ({ ) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to unfollow', {error: String(e)}) + logger.error('Failed to unfollow', {message: String(e)}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } @@ -260,7 +260,7 @@ let ProfileHeaderLoaded = ({ Toast.show(_(msg`Account muted`)) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to mute account', {error: e}) + logger.error('Failed to mute account', {message: e}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } @@ -273,7 +273,7 @@ let ProfileHeaderLoaded = ({ Toast.show(_(msg`Account unmuted`)) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to unmute account', {error: e}) + logger.error('Failed to unmute account', {message: e}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } @@ -293,7 +293,7 @@ let ProfileHeaderLoaded = ({ Toast.show(_(msg`Account blocked`)) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to block account', {error: e}) + logger.error('Failed to block account', {message: e}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } @@ -315,7 +315,7 @@ let ProfileHeaderLoaded = ({ Toast.show(_(msg`Account unblocked`)) } catch (e: any) { if (e?.name !== 'AbortError') { - logger.error('Failed to unblock account', {error: e}) + logger.error('Failed to unblock account', {message: e}) Toast.show(_(msg`There was an issue! ${e.toString()}`)) } } diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx index b21caf2e..940f3905 100644 --- a/src/view/com/util/forms/PostDropdownBtn.tsx +++ b/src/view/com/util/forms/PostDropdownBtn.tsx @@ -82,7 +82,7 @@ let PostDropdownBtn = ({ Toast.show(_(msg`Post deleted`)) }, e => { - logger.error('Failed to delete post', {error: e}) + logger.error('Failed to delete post', {message: e}) Toast.show(_(msg`Failed to delete post, please try again`)) }, ) @@ -99,7 +99,7 @@ let PostDropdownBtn = ({ Toast.show(_(msg`You will now receive notifications for this thread`)) } } catch (e) { - logger.error('Failed to toggle thread mute', {error: e}) + logger.error('Failed to toggle thread mute', {message: e}) } }, [rootUri, toggleThreadMute, _]) diff --git a/src/view/screens/ModerationBlockedAccounts.tsx b/src/view/screens/ModerationBlockedAccounts.tsx index bada3ea9..09d77987 100644 --- a/src/view/screens/ModerationBlockedAccounts.tsx +++ b/src/view/screens/ModerationBlockedAccounts.tsx @@ -66,7 +66,7 @@ export function ModerationBlockedAccounts({}: Props) { try { await refetch() } catch (err) { - logger.error('Failed to refresh my muted accounts', {error: err}) + logger.error('Failed to refresh my muted accounts', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -77,7 +77,7 @@ export function ModerationBlockedAccounts({}: Props) { try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more of my muted accounts', {error: err}) + logger.error('Failed to load more of my muted accounts', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/screens/ModerationMutedAccounts.tsx b/src/view/screens/ModerationMutedAccounts.tsx index 67118e53..1aff19dd 100644 --- a/src/view/screens/ModerationMutedAccounts.tsx +++ b/src/view/screens/ModerationMutedAccounts.tsx @@ -66,7 +66,7 @@ export function ModerationMutedAccounts({}: Props) { try { await refetch() } catch (err) { - logger.error('Failed to refresh my muted accounts', {error: err}) + logger.error('Failed to refresh my muted accounts', {message: err}) } setIsPTRing(false) }, [refetch, setIsPTRing]) @@ -77,7 +77,7 @@ export function ModerationMutedAccounts({}: Props) { try { await fetchNextPage() } catch (err) { - logger.error('Failed to load more of my muted accounts', {error: err}) + logger.error('Failed to load more of my muted accounts', {message: err}) } }, [isFetching, hasNextPage, isError, fetchNextPage]) diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index a968ac00..be9eec81 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -209,7 +209,7 @@ export function ProfileFeedScreenInner({ msg`There was an an issue updating your feeds, please check your internet connection and try again.`, ), ) - logger.error('Failed up update feeds', {error: err}) + logger.error('Failed up update feeds', {message: err}) } }, [ feedInfo, @@ -234,7 +234,7 @@ export function ProfileFeedScreenInner({ } } catch (e) { Toast.show(_(msg`There was an issue contacting the server`)) - logger.error('Failed to toggle pinned feed', {error: e}) + logger.error('Failed to toggle pinned feed', {message: e}) } }, [isPinned, feedInfo, pinFeed, unpinFeed, resetPinFeed, resetUnpinFeed, _]) @@ -549,7 +549,7 @@ function AboutSection({ msg`There was an an issue contacting the server, please check your internet connection and try again.`, ), ) - logger.error('Failed up toggle like', {error: err}) + logger.error('Failed up toggle like', {message: err}) } }, [likeUri, isLiked, feedInfo, likeFeed, unlikeFeed, track, _]) diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx index f41cfa0b..17c93b03 100644 --- a/src/view/screens/ProfileList.tsx +++ b/src/view/screens/ProfileList.tsx @@ -261,7 +261,7 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { } } catch (e) { Toast.show(_(msg`There was an issue contacting the server`)) - logger.error('Failed to toggle pinned feed', {error: e}) + logger.error('Failed to toggle pinned feed', {message: e}) } }, [list.uri, isPinned, pinFeed, unpinFeed, _]) diff --git a/src/view/screens/SavedFeeds.tsx b/src/view/screens/SavedFeeds.tsx index 19ae37f0..251c7063 100644 --- a/src/view/screens/SavedFeeds.tsx +++ b/src/view/screens/SavedFeeds.tsx @@ -207,7 +207,7 @@ function ListItem({ } } catch (e) { Toast.show(_(msg`There was an issue contacting the server`)) - logger.error('Failed to toggle pinned feed', {error: e}) + logger.error('Failed to toggle pinned feed', {message: e}) } }, [feedUri, isPinned, pinFeed, unpinFeed, resetSaveFeedsMutationState, _]) @@ -229,7 +229,7 @@ function ListItem({ }) } catch (e) { Toast.show(_(msg`There was an issue contacting the server`)) - logger.error('Failed to set pinned feed order', {error: e}) + logger.error('Failed to set pinned feed order', {message: e}) } }, [feedUri, isPinned, setSavedFeeds, currentFeeds, _]) @@ -250,7 +250,7 @@ function ListItem({ }) } catch (e) { Toast.show(_(msg`There was an issue contacting the server`)) - logger.error('Failed to set pinned feed order', {error: e}) + logger.error('Failed to set pinned feed order', {message: e}) } }, [feedUri, isPinned, setSavedFeeds, currentFeeds, _]) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index df64cc5a..4703899a 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -153,7 +153,7 @@ function SearchScreenSuggestedFollows() { getSuggestions() } catch (e) { logger.error(`SearchScreenSuggestedFollows: failed to get suggestions`, { - error: e, + message: e, }) } }, [currentAccount, setSuggestions, getSuggestedFollowsByActor]) @@ -480,7 +480,7 @@ export function SearchScreen( setSearchHistory(JSON.parse(history)) } } catch (e: any) { - logger.error('Failed to load search history', e) + logger.error('Failed to load search history', {message: e}) } } @@ -558,7 +558,7 @@ export function SearchScreen( JSON.stringify(newHistory), ) } catch (e: any) { - logger.error('Failed to save search history', e) + logger.error('Failed to save search history', {message: e}) } } }, @@ -598,7 +598,7 @@ export function SearchScreen( setSearchHistory(updatedHistory) AsyncStorage.setItem('searchHistory', JSON.stringify(updatedHistory)).catch( e => { - logger.error('Failed to update search history', e) + logger.error('Failed to update search history', {message: e}) }, ) }