In my scenario
I have multiple SQL connections in Power Query (Power BI)
Sometimes i have connection problems so auto-refresh gives error.
An error example is;
DataSource.Error: Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 – The wait operation timed out.)
Details:
DataSourceKind=SQL DataSourcePath= … Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 – The wait operation timed out.) ErrorCode=-2146232060 Number=258 Class=20
I tried to catch the error via
try Sql.Database(Servername, DatabaseName)
function and it returns
hasError=FALSE, Value=Table
even if there is connection error
How can i add some extra info to error message like “which of my sql connection” occurs error?