Skip to content

Commit 2e1bdee

Browse files
committed
Remove too verbose debug line.
1 parent 0595a0a commit 2e1bdee

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

internal/database/mariadb.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,9 @@ func (m *MariaDB) InsertAssets(source string, assets []knowledge.Asset) error {
269269
if err != nil {
270270
if driverErr, ok := err.(*mysql.MySQLError); ok && driverErr.Number == mysqlerr.ER_DUP_ENTRY {
271271
// If the entry is duplicated, it's fine but we still need insert a line into assets_by_source.
272-
logrus.Debugf("Asset duplicate %d (%s - %s) detected", h, asset.Type, asset.Key)
273272
} else {
274273
tx.Rollback()
275-
return fmt.Errorf("Unable to insert asset %v in DB from source %s: %v", asset, source, err)
274+
return fmt.Errorf("Unable to insert asset %v (%d) in DB from source %s: %v", asset, h, source, err)
276275
}
277276
}
278277

@@ -283,7 +282,7 @@ func (m *MariaDB) InsertAssets(source string, assets []knowledge.Asset) error {
283282
// TODO(c.michaud): update the update_time?
284283
} else {
285284
tx.Rollback()
286-
return fmt.Errorf("Unable to insert binding between asset %s and source %s: %v", asset, source, err)
285+
return fmt.Errorf("Unable to insert binding between asset %s (%d) and source %s: %v", asset, h, source, err)
287286
}
288287
}
289288
}
@@ -320,7 +319,7 @@ func (m *MariaDB) InsertRelations(source string, relations []knowledge.Relation)
320319
// If the entry is duplicated, it's fine but we still need insert a line into relations_by_source.
321320
} else {
322321
tx.Rollback()
323-
return fmt.Errorf("Unable insert relation %v in DB from source %s: %v", relation, source, err)
322+
return fmt.Errorf("Unable insert relation %v (%d) in DB from source %s: %v", relation, rH, source, err)
324323
}
325324
}
326325

@@ -331,7 +330,7 @@ func (m *MariaDB) InsertRelations(source string, relations []knowledge.Relation)
331330
// TODO(c.michaud): update the update_time?
332331
} else {
333332
tx.Rollback()
334-
return fmt.Errorf("Unable to insert binding between relation %v and source %s: %v", relation, source, err)
333+
return fmt.Errorf("Unable to insert binding between relation %v (%d) and source %s: %v", relation, rH, source, err)
335334
}
336335
}
337336
}
@@ -362,7 +361,7 @@ func (m *MariaDB) RemoveAssets(source string, assets []knowledge.Asset) error {
362361
h, sourceID)
363362
if err != nil {
364363
tx.Rollback()
365-
return fmt.Errorf("Unable to remove binding between asset %v and source %s: %v", asset, source, err)
364+
return fmt.Errorf("Unable to remove binding between asset %v (%d) and source %s: %v", asset, h, source, err)
366365
}
367366

368367
_, err = tx.ExecContext(context.Background(),
@@ -372,7 +371,7 @@ func (m *MariaDB) RemoveAssets(source string, assets []knowledge.Asset) error {
372371
h, h)
373372
if err != nil {
374373
tx.Rollback()
375-
return fmt.Errorf("Unable to remove asset %v from source %s: %v", asset, source, err)
374+
return fmt.Errorf("Unable to remove asset %v (%d) from source %s: %v", asset, h, source, err)
376375
}
377376

378377
}
@@ -403,7 +402,7 @@ func (m *MariaDB) RemoveRelations(source string, relations []knowledge.Relation)
403402
rH, sourceID)
404403
if err != nil {
405404
tx.Rollback()
406-
return fmt.Errorf("Unable to remove binding between relation %v and source %s: %v", relation, source, err)
405+
return fmt.Errorf("Unable to remove binding between relation %v (%d) and source %s: %v", relation, rH, source, err)
407406
}
408407

409408
_, err = tx.ExecContext(context.Background(),
@@ -413,7 +412,7 @@ func (m *MariaDB) RemoveRelations(source string, relations []knowledge.Relation)
413412
rH, rH)
414413
if err != nil {
415414
tx.Rollback()
416-
return fmt.Errorf("Unable to remove relation %v from source %s: %v", relation, source, err)
415+
return fmt.Errorf("Unable to remove relation %v (%d) from source %s: %v", relation, rH, source, err)
417416
}
418417
}
419418

0 commit comments

Comments
 (0)