When the client closes websocket connections that sends container
output through websocket, an error message is displayed:
"Error attaching websocket: %!s(<nil>)"
This message is misleading. Thus, this change suggests to check
if error is nil and print the correct message accordingly.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
| ... | ... |
@@ -593,7 +593,11 @@ func (s *containerRouter) wsContainersAttach(ctx context.Context, w http.Respons |
| 593 | 593 |
close(done) |
| 594 | 594 |
select {
|
| 595 | 595 |
case <-started: |
| 596 |
- logrus.Errorf("Error attaching websocket: %s", err)
|
|
| 596 |
+ if err != nil {
|
|
| 597 |
+ logrus.Errorf("Error attaching websocket: %s", err)
|
|
| 598 |
+ } else {
|
|
| 599 |
+ logrus.Debug("websocket connection was closed by client")
|
|
| 600 |
+ } |
|
| 597 | 601 |
return nil |
| 598 | 602 |
default: |
| 599 | 603 |
} |