Skip to content

Commit 5659b5a

Browse files
committed
Adiciona tratamento de exceções para SqlException
O código agora inclui um bloco `catch` para capturar exceções do tipo `SqlException`. Mensagens de erro detalhadas são impressas, incluindo a mensagem de erro, número e estado da conexão. A linha que comentava sobre a captura de exceções foi removida, melhorando a forma como os erros de conexão são tratados e reportados.
1 parent fbc6573 commit 5659b5a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎SPOtoSQL-Snapshots/ConsoleApp1/SPODataQuality/RefreshSPOLists.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private static void TestSQLConnection()
125125
}
126126
}
127127
}
128-
// If the connection is not working, catch the exception and print the error message
128+
129129
catch (SqlException ex)
130130
{
131131
Console.WriteLine($"SQL connection error: {ex.Message}");

0 commit comments

Comments
 (0)