How to catch an error log on an automation to act in consequence?

i have an automation that triggers an script that use the camera.play_stream service but my wyze cam is very unreliable using this and the service crash after couple minutes (i already report the bug btw but believe is something inherent to the camera firmware).

The point is if the service crash the stream freeze but if in that point i call the script again the service “reboots” and work again.

So how i catch the error in the logger to trigger again the script?

i tried with the event viewer but i can find anything about the logger in the time i checked with “see all the events”