diff options
Diffstat (limited to 'src/state/models/feeds')
-rw-r--r-- | src/state/models/feeds/notifications.ts | 19 | ||||
-rw-r--r-- | src/state/models/feeds/post.ts | 17 | ||||
-rw-r--r-- | src/state/models/feeds/posts.ts | 9 |
3 files changed, 23 insertions, 22 deletions
diff --git a/src/state/models/feeds/notifications.ts b/src/state/models/feeds/notifications.ts index 34f5d4add..a834b543a 100644 --- a/src/state/models/feeds/notifications.ts +++ b/src/state/models/feeds/notifications.ts @@ -220,7 +220,7 @@ export class NotificationsFeedItemModel { } this.rootStore.log.warn( 'app.bsky.notifications.list served an unsupported record type', - v, + {record: v}, ) } @@ -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 d46cced75..be3417104 100644 --- a/src/state/models/feeds/post.ts +++ b/src/state/models/feeds/post.ts @@ -42,17 +42,16 @@ export class PostsFeedItemModel { } else { this.postRecord = undefined this.richText = undefined - rootStore.log.warn( - 'Received an invalid app.bsky.feed.post record', - valid.error, - ) + rootStore.log.warn('Received an invalid app.bsky.feed.post record', { + error: valid.error, + }) } } else { this.postRecord = undefined 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 @@ -133,7 +132,7 @@ export class PostsFeedItemModel { track('Post:Like') } } catch (error) { - this.rootStore.log.error('Failed to toggle like', error) + this.rootStore.log.error('Failed to toggle like', {error}) } } @@ -168,7 +167,7 @@ export class PostsFeedItemModel { track('Post:Repost') } } catch (error) { - this.rootStore.log.error('Failed to toggle repost', error) + this.rootStore.log.error('Failed to toggle repost', {error}) } } @@ -182,7 +181,7 @@ export class PostsFeedItemModel { track('Post:ThreadMute') } } catch (error) { - this.rootStore.log.error('Failed to toggle thread mute', error) + this.rootStore.log.error('Failed to toggle thread mute', {error}) } } @@ -191,7 +190,7 @@ export class PostsFeedItemModel { await this.rootStore.agent.deletePost(this.post.uri) this.rootStore.emitPostDeleted(this.post.uri) } catch (error) { - this.rootStore.log.error('Failed to delete post', error) + this.rootStore.log.error('Failed to delete post', {error}) } finally { track('Post:Delete') } 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, + }) } } |