i tried running that, but i couldnt understand when the catch block was supposed to be triggered. When ErrorLevel != 0 ? When A_LastError != 0 ?
i stripped it down to this:
Code: Select all
try
{
FileCopy("D:\test.txt", "D:\Backup")
}
catch
{
MsgBox("There was a problem while backing the files up!",, 16)
ExitApp
}
MsgBox(Format("ErrorLevel: {}`nLastError: {}", ErrorLevel, A_LastError))
the 2nd time its run, it will fail to copy the file(overwrite flag omitted, disabled by default), ErrorLevel = 1, LastError = 80 ERROR_FILE_EXISTS, yet catch still isnt being triggered
so what was supposed to happen here? it works when handling messed up COM objects, but thats because they throw runtime exceptions