I am trying to do a query in a data warehouse using the Run Query activity. I have this error message appears when the activity times out: “Run query: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.”
I want to be able to do activities when the query times out and have tried to use the Microsoft.Data.SqlClient.SqlException as the exception type in the try catch but it won’t go through that error catch path.
Any another way for me to try and catch this error?
Hi @redanime94,
I know this is not the best practice, but can you try using a more general form of Exception - System.Exception so that it catches all the errors and you can write your own logic to handle this?
Hello @redanime94 - The defined exception Microsoft.Data.SqlClient.SqlException in the catch is not the one that it was giving during run time. Hence, it was not able to catch that error. Can you try defining system.exception in the catch block and see how it goes
hi, i have tried this and had an if statement that will check if the exception message contains “Execution Timeout Expired” but to no avail. It still wouldn’t go in that loop.
Maybe the error message isn’t “Execution Timeout Expired”. As per your screenshot, can you add a log message (with your Exception message) in your System.Exception catch sequence and verify if you are getting any logs for this
This is the log message that I get:
Run query: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.