mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
KyselyLogger: don't log expected errors
This commit is contained in:
parent
3a260f7873
commit
3a849700db
1 changed files with 8 additions and 0 deletions
|
|
@ -18,6 +18,14 @@ export const KyselyLogger: Logger = (event) => {
|
|||
}
|
||||
|
||||
if (event.level === 'error') {
|
||||
if (event.error instanceof Error) {
|
||||
switch (event.error.message) {
|
||||
case 'duplicate key value violates unique constraint "nostr_events_pkey"':
|
||||
case 'duplicate key value violates unique constraint "author_stats_pkey"':
|
||||
return; // Don't log expected errors
|
||||
}
|
||||
}
|
||||
|
||||
logi({
|
||||
level: 'error',
|
||||
ns: 'ditto.sql',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue