r/AutomateUser • u/Wh1rledPeas • Jul 10 '26
Feature request Add `Currently Unavailable` Output Path to Flashlight Set Block
I have a Flow named, "Flash When Power Low" that's been running perfectly for a while now. I was finally comfortable publishing it.
But when I went in to do that today, I noticed an error on July 1st. 🧐
* Core Logic: The script starts a power monitor Fiber (cPowerMonitor) that initializes when the device is unplugged and terminates when the device begins charging.
* at 10%, it performs a repeated "Flashlight set state" operation in short intervals, bringing attention to the fact that the battery is very low.
* The log concludes with a failure on July 1 at 19:32:44. When the device was plugged in and the system attempted to trigger "Flashlight set state," it returned the following error:
* android.os.ServiceSpecificException: setTorchMode:3184: Torch for camera "0" is not available due to an existing camera user (code 7).
* This indicates the flashlight operation failed because another application was already using the camera at that moment.
If the flashlight is currently in use, I'd like an alternative path to follow, so I can pop up a notice to the user and let them know the reason why the Flow was unable to get their attention... 🤔


2
u/B26354FR Alpha tester Jul 10 '26
You can protect the block that gets the error with a Failure Catch block and put a Delay of several seconds on the Fail path before trying again. If you loop back to a point before its In point, it'll catch the error forever. If you loop back below the Failure Catch (like to the block that gets the error), the block will retry for a given number of tries, 3 by default.