Get info from error message
PlannedI am trying to create an error notification for a script.
I have set up a an error task that is executed each time a script stops and sends an e-mail to the relevant person.
So far the e-mail contains the name of the process, name of the task and the specific line number where the script has stopped. This is very useful but the problem is that when an error task is executed the actual error message does never appear, therefore it can be difficult to determain how to fix the issue.
Does anyone know if it is possible to get the information from the error message (that does not appear) into an e-mail?
Best regards,
Aleksander R. Kristiansen
-
Thanks for the suggestion James, but it won't help me this time, since then I would have to record all the runs all the time, which isn't convenient. The problem is that if the error isn't obvious it's impossible to know what happened, like one I had today, i know the step it failed on, but no idea why, because when I reran the bot it worked fine...
-
Nowhere near as useful as natively reporting the actual error or automatically being able to screenshot when errors are encountered, but maybe this will still help?
Only record the parts you want to see :). OBSCommand utility will start/stop it on command, or you can use a file type that does not mind being rudely interrupted and just kill OBS when finished recording.
Put this in as a Powershell action before the part you want to examine. First if OBS is running then it will stop the current recording and begin a new one so you get your target part right at the beginning. If OBS is not already running, it will launch OBS minimized and begin recording. After the part you want to see, run the second section as a Powershell action to stop it, or else just kill the whole OBS process with stop-process.
if (get-process "obs64" -ErrorAction SilentlyContinue) {
Start-Process "D:\OBSCommand\OBSCommand.exe" -ArgumentList "/stoprecording"; Sleep 2
Start-Process "D:\OBSCommand\OBSCommand.exe" -ArgumentList "/startrecording"; Sleep 2
} Else {
Set-Location "C:\Program Files\obs-studio\bin\64bit\"
Start-Process -FilePath "obs64.exe" -ArgumentList "--startrecording","--minimize-to-tray"; sleep 5
}
recording.
############# Then this to stop the recording in another Powershell action
if (get-process "obs64" -ErrorAction SilentlyContinue) {
Start-Process "D:\OBSCommand\OBSCommand.exe" -ArgumentList "/stoprecording"; Sleep 2
}I also scheduled a windows task that runs hourly and stops any active OBS recordings unless one of several other programs is also still running, indicating that either a job is in progress or the job is hung up completely.
-
This will be useful for other error handling, thanks for sharing :) However the issue I had couldn't been seen, since it was executed without GUI. I managed to identify what was causing it, but it required adding 20 more steps to log everything what's going on and waiting for it to happen again.
Please sign in to leave a comment.
Comments
8 comments