Handle error while creating checksum
This commit is contained in:
parent
748c965d48
commit
c759ce19a5
@ -10,12 +10,14 @@ Public Class ClassIndexFunctions
|
|||||||
Filename = Filename.Replace("'", "''")
|
Filename = Filename.Replace("'", "''")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
' If file cannot be accessed, checksum cannot be generated
|
||||||
oHash = FILESYSTEM.GetChecksum(Filename)
|
' In this case, the file should be treated as not yet existing
|
||||||
Catch ex As Exception
|
oHash = FILESYSTEM.GetChecksum(Filename)
|
||||||
LOGGER.Error(ex)
|
|
||||||
oHash = ""
|
If oHash Is Nothing Then
|
||||||
End Try
|
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"
|
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)
|
Dim oResult As DataTable = ClassDatabase.Return_Datatable_CS(oSQL, MyConnectionString, True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user