Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit a421ffd

Browse files
committed
common: Improved logging of failed integrity checks for uploaded files
1 parent 435a026 commit a421ffd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

common/sqlite.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,11 +1285,17 @@ func SQLiteSanityCheck(fileName string) (tables []string, err error) {
12851285

12861286
// Check for a failure
12871287
if !ok || err != nil {
1288-
log.Printf("Error when running an integrity check on the database: %s", err)
1288+
if err != nil {
1289+
log.Printf("Error when running a SQLite integrity check on the file '%s': %s", fileName, err)
1290+
} else {
1291+
err = errors.New("SQLite integrity check failed on file")
1292+
}
12891293
if len(results) > 0 {
1294+
log.Printf("SQLite integrity check failed on file: '%s'. Results below:", fileName)
12901295
for _, b := range results {
12911296
log.Printf(" * %v", b)
12921297
}
1298+
log.Printf("End of SQLite integrity check results for '%s'", fileName)
12931299
}
12941300
return
12951301
}

0 commit comments

Comments
 (0)