File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1087,7 +1087,7 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
10871087 try
10881088 {
10891089 conn . Open ( ) ;
1090- Console . WriteLine ( String . Format ( "Connection state= {0}" , conn . State ) ) ;
1090+ Console . WriteLine ( String . Format ( "Connection {0}" , conn . State ) ) ;
10911091
10921092 WriteToEventTable ( contractEvent , conn ) ;
10931093
@@ -1100,18 +1100,18 @@ private static void WriteToPsql(SmartContractEvent contractEvent)
11001100 {
11011101 WriteToTradeTable ( contractEvent , conn ) ;
11021102 }
1103-
1104- conn . Close ( ) ;
1105- Console . WriteLine ( String . Format ( "Connection state={0}" , conn . State ) ) ;
11061103 }
11071104 catch ( Exception ex )
1105+ {
1106+ throw ex ;
1107+ }
1108+ finally
11081109 {
11091110 if ( conn != null && conn . State == System . Data . ConnectionState . Open )
11101111 {
1111- Console . WriteLine ( String . Format ( "Connection state={0}" , conn . State ) ) ;
11121112 conn . Close ( ) ;
1113+ Console . WriteLine ( String . Format ( "Connection {0}" , conn . State ) ) ;
11131114 }
1114- throw ex ;
11151115 }
11161116 }
11171117
You can’t perform that action at this time.
0 commit comments