Handle error while creating checksum
This commit is contained in:
parent
748c965d48
commit
c759ce19a5
@ -10,12 +10,14 @@ Public Class ClassIndexFunctions
|
||||
Filename = Filename.Replace("'", "''")
|
||||
End If
|
||||
|
||||
Try
|
||||
oHash = FILESYSTEM.GetChecksum(Filename)
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
oHash = ""
|
||||
End Try
|
||||
' If file cannot be accessed, checksum cannot be generated
|
||||
' In this case, the file should be treated as not yet existing
|
||||
oHash = FILESYSTEM.GetChecksum(Filename)
|
||||
|
||||
If oHash Is Nothing Then
|
||||
LOGGER.Warn("Checksum for file {0} could not be generated. Treating as new file.", Filename)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
oSQL = "SELECT * FROM TBGI_FILES_USER WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') AND WORKED = 0 ORDER BY ADDED_WHEN"
|
||||
Dim oResult As DataTable = ClassDatabase.Return_Datatable_CS(oSQL, MyConnectionString, True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user