Mhh... setz einfach nach jedem Befehl in Autoit ein
PHP Code:
If @Error Then _FileWriteLog(@ScriptDir & '\error.log', "Error #" & String(@error) & " in Zeile #"String(@ScriptLineNumber-1) & "! Extended: " & String(@extended))
und schon haste den perfekten @Error-Logger ^^ das klappt natürlich nur, wenn du sauber programmiert hast und nicht son schwachsin wie das hier gemacht hast:
PHP Code:
Local $aArray[2]
MsgBox(0, "", $aArray[99])
^^
Aber dafür habe ich natürlich auch ne kleines Script... funktioniert per stdoutread:
PHP Code:
Func _AutoItErrorHandler()
If StringInStr($CmdLineRaw, "/AutoIt3ExecuteScript") Then Return
Local $sErrorMsg = ""
Local $sRunLine = @AutoItExe & ' /ErrorStdOut /AutoIt3ExecuteScript "' & @ScriptFullPath & '"'
Local $iPID = Run($sRunLine, @ScriptDir, 0, 2 + 4)
ProcessWait($iPID)
While 1
$sErrorMsg &= StdoutRead($iPID)
If @error Then ExitLoop
Sleep(1)
WEnd
If $sErrorMsg = "" Then Exit
MsgBox(262144+48, "AutoIt3 Error Message", _
StringFormat("Program Terminated <%s>.\n\nError Message:\n\n%s\n\n" & _
"Please report about this bug to the author, sorry for the inconvenience! :( ", @ScriptName, $sErrorMsg))
Exit
EndFunc
Einfach beim start callen...
PHP Code:
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
_AutoItErrorHandler()
MsgBox(0,"","")
MsgBox(0, "" ;This is meant to produce an error !
Func _AutoItErrorHandler()
If StringInStr($CmdLineRaw, "/AutoIt3ExecuteScript") Then Return
Local $sErrorMsg = ""
Local $sRunLine = @AutoItExe & ' /ErrorStdOut /AutoIt3ExecuteScript "' & @ScriptFullPath & '"'
Local $iPID = Run($sRunLine, @ScriptDir, 0, 2 + 4)
ProcessWait($iPID)
While 1
$sErrorMsg &= StdoutRead($iPID)
If @error Then ExitLoop
Sleep(1)
WEnd
If $sErrorMsg = "" Then Exit
MsgBox(262144+48, "AutoIt3 Error Message", _
StringFormat("Program Terminated <%s>.\n\nError Message:\n\n%s\n\n" & _
"Please report about this bug to the author, sorry for the inconvenience! :( ", @ScriptName, $sErrorMsg))
Exit
EndFunc
MfG