diff options
Diffstat (limited to 'src/state')
-rw-r--r-- | src/state/index.ts | 2 | ||||
-rw-r--r-- | src/state/models/content/post-thread.ts | 2 | ||||
-rw-r--r-- | src/state/models/content/profile.ts | 2 | ||||
-rw-r--r-- | src/state/models/discovery/feeds.ts | 2 | ||||
-rw-r--r-- | src/state/models/discovery/suggested-actors.ts | 2 | ||||
-rw-r--r-- | src/state/models/feeds/notifications.ts | 17 | ||||
-rw-r--r-- | src/state/models/feeds/post.ts | 2 | ||||
-rw-r--r-- | src/state/models/feeds/posts.ts | 9 | ||||
-rw-r--r-- | src/state/models/lists/actor-feeds.ts | 2 | ||||
-rw-r--r-- | src/state/models/lists/blocked-accounts.ts | 2 | ||||
-rw-r--r-- | src/state/models/lists/likes.ts | 2 | ||||
-rw-r--r-- | src/state/models/lists/lists-list.ts | 6 | ||||
-rw-r--r-- | src/state/models/lists/muted-accounts.ts | 2 | ||||
-rw-r--r-- | src/state/models/lists/reposted-by.ts | 2 | ||||
-rw-r--r-- | src/state/models/lists/user-followers.ts | 2 | ||||
-rw-r--r-- | src/state/models/root-store.ts | 4 | ||||
-rw-r--r-- | src/state/models/ui/create-account.ts | 4 | ||||
-rw-r--r-- | src/state/models/ui/profile.ts | 12 | ||||
-rw-r--r-- | src/state/models/ui/saved-feeds.ts | 2 |
19 files changed, 44 insertions, 34 deletions
diff --git a/src/state/index.ts b/src/state/index.ts index 42687a229..2c81c0ddf 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -25,7 +25,7 @@ export async function setupState(serviceUri = DEFAULT_SERVICE) { rootStore.log.debug('Initial hydrate', {hasSession: !!data.session}) rootStore.hydrate(data) } catch (e: any) { - rootStore.log.error('Failed to load state from storage', e) + rootStore.log.error('Failed to load state from storage', {error: e}) } rootStore.attemptSessionResumption() diff --git a/src/state/models/content/post-thread.ts b/src/state/models/content/post-thread.ts index a862c27d3..cf6377da7 100644 --- a/src/state/models/content/post-thread.ts +++ b/src/state/models/content/post-thread.ts @@ -163,7 +163,7 @@ export class PostThreadModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch post thread', err) + this.rootStore.log.error('Failed to fetch post thread', {error: err}) } this.notFound = err instanceof GetPostThread.NotFoundError } diff --git a/src/state/models/content/profile.ts b/src/state/models/content/profile.ts index 5333e7116..0050970e6 100644 --- a/src/state/models/content/profile.ts +++ b/src/state/models/content/profile.ts @@ -235,7 +235,7 @@ export class ProfileModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch profile', err) + this.rootStore.log.error('Failed to fetch profile', {error: err}) } } diff --git a/src/state/models/discovery/feeds.ts b/src/state/models/discovery/feeds.ts index 1a00f802c..3902f3ac1 100644 --- a/src/state/models/discovery/feeds.ts +++ b/src/state/models/discovery/feeds.ts @@ -120,7 +120,7 @@ export class FeedsDiscoveryModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch popular feeds', err) + this.rootStore.log.error('Failed to fetch popular feeds', {error: err}) } } diff --git a/src/state/models/discovery/suggested-actors.ts b/src/state/models/discovery/suggested-actors.ts index d270267ee..8776fcd85 100644 --- a/src/state/models/discovery/suggested-actors.ts +++ b/src/state/models/discovery/suggested-actors.ts @@ -144,7 +144,7 @@ export class SuggestedActorsModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch suggested actors', err) + this.rootStore.log.error('Failed to fetch suggested actors', {error: err}) } } } diff --git a/src/state/models/feeds/notifications.ts b/src/state/models/feeds/notifications.ts index 3f18c18d7..a834b543a 100644 --- a/src/state/models/feeds/notifications.ts +++ b/src/state/models/feeds/notifications.ts @@ -401,7 +401,9 @@ export class NotificationsFeedModel { this._setQueued(this._filterNotifications(queueModels)) this._countUnread() } catch (e) { - this.rootStore.log.error('NotificationsModel:syncQueue failed', {e}) + this.rootStore.log.error('NotificationsModel:syncQueue failed', { + error: e, + }) } finally { this.lock.release() } @@ -481,7 +483,9 @@ export class NotificationsFeedModel { this.lastSync ? this.lastSync.toISOString() : undefined, ) } catch (e: any) { - this.rootStore.log.warn('Failed to update notifications read state', e) + this.rootStore.log.warn('Failed to update notifications read state', { + error: e, + }) } } @@ -501,13 +505,12 @@ export class NotificationsFeedModel { this.error = cleanError(error) this.loadMoreError = cleanError(loadMoreError) if (error) { - this.rootStore.log.error('Failed to fetch notifications', error) + this.rootStore.log.error('Failed to fetch notifications', {error}) } if (loadMoreError) { - this.rootStore.log.error( - 'Failed to load more notifications', - loadMoreError, - ) + this.rootStore.log.error('Failed to load more notifications', { + error: loadMoreError, + }) } } diff --git a/src/state/models/feeds/post.ts b/src/state/models/feeds/post.ts index 3def5dce3..be3417104 100644 --- a/src/state/models/feeds/post.ts +++ b/src/state/models/feeds/post.ts @@ -51,7 +51,7 @@ export class PostsFeedItemModel { this.richText = undefined rootStore.log.warn( 'app.bsky.feed.getTimeline or app.bsky.feed.getAuthorFeed served an unexpected record type', - this.post.record, + {record: this.post.record}, ) } this.reply = v.reply diff --git a/src/state/models/feeds/posts.ts b/src/state/models/feeds/posts.ts index 3c580aca9..5c10ae4c7 100644 --- a/src/state/models/feeds/posts.ts +++ b/src/state/models/feeds/posts.ts @@ -324,13 +324,12 @@ export class PostsFeedModel { this.knownError = detectKnownError(this.feedType, error) this.loadMoreError = cleanError(loadMoreError) if (error) { - this.rootStore.log.error('Posts feed request failed', error) + this.rootStore.log.error('Posts feed request failed', {error}) } if (loadMoreError) { - this.rootStore.log.error( - 'Posts feed load-more request failed', - loadMoreError, - ) + this.rootStore.log.error('Posts feed load-more request failed', { + error: loadMoreError, + }) } } diff --git a/src/state/models/lists/actor-feeds.ts b/src/state/models/lists/actor-feeds.ts index d2bd7680b..65da765f1 100644 --- a/src/state/models/lists/actor-feeds.ts +++ b/src/state/models/lists/actor-feeds.ts @@ -98,7 +98,7 @@ export class ActorFeedsModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch user followers', err) + this.rootStore.log.error('Failed to fetch user followers', {error: err}) } } diff --git a/src/state/models/lists/blocked-accounts.ts b/src/state/models/lists/blocked-accounts.ts index 20eef8aff..b4495b543 100644 --- a/src/state/models/lists/blocked-accounts.ts +++ b/src/state/models/lists/blocked-accounts.ts @@ -86,7 +86,7 @@ export class BlockedAccountsModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch user followers', err) + this.rootStore.log.error('Failed to fetch user followers', {error: err}) } } diff --git a/src/state/models/lists/likes.ts b/src/state/models/lists/likes.ts index dd3cf18a3..61e480e19 100644 --- a/src/state/models/lists/likes.ts +++ b/src/state/models/lists/likes.ts @@ -97,7 +97,7 @@ export class LikesModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch likes', err) + this.rootStore.log.error('Failed to fetch likes', {error: err}) } } diff --git a/src/state/models/lists/lists-list.ts b/src/state/models/lists/lists-list.ts index 42638757a..7415d06d7 100644 --- a/src/state/models/lists/lists-list.ts +++ b/src/state/models/lists/lists-list.ts @@ -204,10 +204,12 @@ export class ListsListModel { this.error = cleanError(err) this.loadMoreError = cleanError(loadMoreErr) if (err) { - this.rootStore.log.error('Failed to fetch user lists', err) + this.rootStore.log.error('Failed to fetch user lists', {error: err}) } if (loadMoreErr) { - this.rootStore.log.error('Failed to fetch user lists', loadMoreErr) + this.rootStore.log.error('Failed to fetch user lists', { + error: loadMoreErr, + }) } } diff --git a/src/state/models/lists/muted-accounts.ts b/src/state/models/lists/muted-accounts.ts index 9c3e1157b..bc9e53e5c 100644 --- a/src/state/models/lists/muted-accounts.ts +++ b/src/state/models/lists/muted-accounts.ts @@ -86,7 +86,7 @@ export class MutedAccountsModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch user followers', err) + this.rootStore.log.error('Failed to fetch user followers', {error: err}) } } diff --git a/src/state/models/lists/reposted-by.ts b/src/state/models/lists/reposted-by.ts index 5d4fc107d..fe639fd0e 100644 --- a/src/state/models/lists/reposted-by.ts +++ b/src/state/models/lists/reposted-by.ts @@ -100,7 +100,7 @@ export class RepostedByModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch reposted by view', err) + this.rootStore.log.error('Failed to fetch reposted by view', {error: err}) } } diff --git a/src/state/models/lists/user-followers.ts b/src/state/models/lists/user-followers.ts index 1f817c33c..d76ecce1a 100644 --- a/src/state/models/lists/user-followers.ts +++ b/src/state/models/lists/user-followers.ts @@ -99,7 +99,7 @@ export class UserFollowersModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch user followers', err) + this.rootStore.log.error('Failed to fetch user followers', {error: err}) } } diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts index c9b460ba4..621c87c11 100644 --- a/src/state/models/root-store.ts +++ b/src/state/models/root-store.ts @@ -130,7 +130,7 @@ export class RootStoreModel { }) this.updateSessionState() } catch (e: any) { - this.log.warn('Failed to initialize session', e) + this.log.warn('Failed to initialize session', {error: e}) } } @@ -184,7 +184,7 @@ export class RootStoreModel { await this.me.updateIfNeeded() await this.preferences.sync() } catch (e: any) { - this.log.error('Failed to fetch latest state', e) + this.log.error('Failed to fetch latest state', {error: e}) } } diff --git a/src/state/models/ui/create-account.ts b/src/state/models/ui/create-account.ts index 9f11a9b31..3bd39ba76 100644 --- a/src/state/models/ui/create-account.ts +++ b/src/state/models/ui/create-account.ts @@ -78,7 +78,7 @@ export class CreateAccountModel { } catch (err: any) { this.rootStore.log.warn( `Failed to fetch service description for ${this.serviceUrl}`, - err, + {error: err}, ) this.setError( 'Unable to contact your service. Please check your Internet connection.', @@ -127,7 +127,7 @@ export class CreateAccountModel { errMsg = 'Invite code not accepted. Check that you input it correctly and try again.' } - this.rootStore.log.error('Failed to create account', e) + this.rootStore.log.error('Failed to create account', {error: e}) this.setIsProcessing(false) this.setError(cleanError(errMsg)) throw e diff --git a/src/state/models/ui/profile.ts b/src/state/models/ui/profile.ts index 8525426bf..47a99a8fc 100644 --- a/src/state/models/ui/profile.ts +++ b/src/state/models/ui/profile.ts @@ -223,10 +223,14 @@ export class ProfileUiModel { await Promise.all([ this.profile .setup() - .catch(err => this.rootStore.log.error('Failed to fetch profile', err)), + .catch(err => + this.rootStore.log.error('Failed to fetch profile', {error: err}), + ), this.feed .setup() - .catch(err => this.rootStore.log.error('Failed to fetch feed', err)), + .catch(err => + this.rootStore.log.error('Failed to fetch feed', {error: err}), + ), ]) runInAction(() => { this.isAuthenticatedUser = @@ -237,7 +241,9 @@ export class ProfileUiModel { this.lists.source = this.profile.did this.lists .loadMore() - .catch(err => this.rootStore.log.error('Failed to fetch lists', err)) + .catch(err => + this.rootStore.log.error('Failed to fetch lists', {error: err}), + ) } async refresh() { diff --git a/src/state/models/ui/saved-feeds.ts b/src/state/models/ui/saved-feeds.ts index 667bc03a3..72055abeb 100644 --- a/src/state/models/ui/saved-feeds.ts +++ b/src/state/models/ui/saved-feeds.ts @@ -126,7 +126,7 @@ export class SavedFeedsModel { this.hasLoaded = true this.error = cleanError(err) if (err) { - this.rootStore.log.error('Failed to fetch user feeds', err) + this.rootStore.log.error('Failed to fetch user feeds', {err}) } } |