How to catch error "Task timed out after 10.01 seconds"

My function
sometimes get time out.

My question is how to catch this and not showing the error

Thank you.

You’d need to implement a timer within your function to abort before 10 seconds and do cleanup. I’d suggest 9s, since 10s is the absolute end so setting it “at” 10 seconds would mean the function is already shutting down by the time your timer activates.