File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ import (
1212func execConnect (ctx * ExecContext , s * ast.ConnectStmt ) error {
1313 e := ctx .executor
1414 if e .backend != nil && e .backend .IsConnected () {
15- e .backend .Disconnect ()
15+ if err := e .backend .Disconnect (); err != nil {
16+ fmt .Fprintf (ctx .Output , "Warning: disconnect error: %v\n " , err )
17+ }
1618 }
1719
1820 if e .backendFactory == nil {
@@ -61,7 +63,9 @@ func reconnect(ctx *ExecContext) error {
6163
6264 // Close existing connection
6365 if e .backend != nil && e .backend .IsConnected () {
64- e .backend .Disconnect ()
66+ if err := e .backend .Disconnect (); err != nil {
67+ fmt .Fprintf (ctx .Output , "Warning: disconnect error: %v\n " , err )
68+ }
6569 }
6670
6771 // Reopen connection
@@ -101,7 +105,9 @@ func execDisconnect(ctx *ExecContext) error {
101105 fmt .Fprintf (ctx .Output , "Warning: finalization error: %v\n " , err )
102106 }
103107
104- e .backend .Disconnect ()
108+ if err := e .backend .Disconnect (); err != nil {
109+ fmt .Fprintf (ctx .Output , "Warning: disconnect error: %v\n " , err )
110+ }
105111 fmt .Fprintf (ctx .Output , "Disconnected from: %s\n " , e .mprPath )
106112 e .mprPath = ""
107113 e .cache = nil
You can’t perform that action at this time.
0 commit comments