Skip to content

Commit

Permalink
Improve logging for connection state
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 6, 2018
1 parent cb20e5d commit 9c484f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions neo-cli/Shell/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
try
{
conn.Open();
Console.WriteLine(String.Format("Connection state={0}", conn.State));

WriteToEventTable(contractEvent, conn);

Expand All @@ -1101,11 +1102,13 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
}

conn.Close();
Console.WriteLine(String.Format("Connection state={0}", conn.State));
}
catch (Exception ex)
{
if (conn != null && conn.State == System.Data.ConnectionState.Open)
{
Console.WriteLine(String.Format("Connection state={0}", conn.State));
conn.Close();
}
throw ex;
Expand Down

0 comments on commit 9c484f8

Please sign in to comment.