Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Mar 18, 2022
1 parent e4dea81 commit e00cfdb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dbs/bulkblocks2.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ func insertFilesViaChunks(tx *sql.Tx, records []File, trec *TempFileRecord) erro
}
if utils.VERBOSE > 0 {
log.Printf(
"insertFilesViaChunks processed %d goroutines, elapsed time %v",
ngoroutines, time.Since(t0))
"insertFilesViaChunks processed %d goroutines with ids %v, elapsed time %v",
ngoroutines, ids, time.Since(t0))
}
wg.Wait()
if trec.NErrors != 0 {
Expand Down
13 changes: 8 additions & 5 deletions dbs/fileparents.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,20 +408,23 @@ func (a *API) InsertFileParentsTxt(tx *sql.Tx) error {
log.Printf("Insert FileParents record %+v", rec)
}
lfn := rec.LogicalFileName
pfn := rec.ParentLogicalFileName
// get file id for given lfn
fid, err := GetID(tx, "FILES", "file_id", "logical_file_name", lfn)
if err != nil {
msg := fmt.Sprintf("unable to find logical_file_name file_id for %v", lfn)
if utils.VERBOSE > 1 {
log.Println("unable to find logical_file_name file_id for", rec)
log.Println(msg)
}
return Error(err, GetIDErrorCode, "", "dbs.fileparents.InsertFileParentsTxt")
return Error(err, GetIDErrorCode, msg, "dbs.fileparents.InsertFileParentsTxt")
}
pid, err := GetID(tx, "FILES", "file_id", "logical_file_name", rec.ParentLogicalFileName)
pid, err := GetID(tx, "FILES", "file_id", "logical_file_name", pfn)
if err != nil {
msg := fmt.Sprintf("unable to find parent_logical_file_name file_id for %s", pfn)
if utils.VERBOSE > 1 {
log.Println("unable to find parent_logical_file_name file_id for", rec.ParentLogicalFileName)
log.Println(msg)
}
return Error(err, GetIDErrorCode, "", "dbs.fileparents.InsertFileParentsTxt")
return Error(err, GetIDErrorCode, msg, "dbs.fileparents.InsertFileParentsTxt")
}
var rrr FileParents
rrr.THIS_FILE_ID = fid
Expand Down

0 comments on commit e00cfdb

Please sign in to comment.