Skip to content

Commit

Permalink
fix: logs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed May 9, 2024
1 parent 75fb23e commit 2703aad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/nest/storage/base.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class StoreBase<V, S extends KeyValueStore<V> | EventStore<V>> extends
}

async close(): Promise<void> {
logger('Closing', this.getAddress())
logger('Closing', this.getAddress().path)
await this.store?.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export class UserProfileStore extends KeyValueStoreBase<UserProfile> {
if (!UserProfileStore.validateUserProfile(userProfile)) {
// TODO: Send validation errors to frontend or replicate
// validation on frontend?
logger.error('Failed to add user profile', userProfile.pubKey)
logger.error('Failed to add user profile, profile is invalid', userProfile.pubKey)
throw new Error('Failed to add user profile')
}
await this.getStore().put(key, userProfile)
} catch (err) {
logger.error('Failed to add user profile', err)
logger.error('Failed to add user profile', userProfile.pubKey, err)
throw new Error('Failed to add user profile')
}
return userProfile
Expand Down Expand Up @@ -156,6 +156,7 @@ export class UserProfileStore extends KeyValueStoreBase<UserProfile> {
}

clean(): void {
logger('Cleaning user profiles store')
this.store = undefined
}
}
Expand Down

0 comments on commit 2703aad

Please sign in to comment.