def on_error(exc)
      case exc
      when Kontena::Websocket::SSLVerifyError
        if exc.cert
          error "unable to connect to SSL server with KONTENA_SSL_VERIFY=true: #{exc} (subject #{exc.subject}, issuer #{exc.issuer})"
        else
          error "unable to connect to SSL server with KONTENA_SSL_VERIFY=true: #{exc}"
        end

      when Kontena::Websocket::SSLConnectError
        error "unable to connect to SSL server: #{exc}"

      when Kontena::Websocket::ConnectError
        error "unable to connect to server: #{exc}"

      when Kontena::Websocket::ProtocolError
        error "unexpected response from server, check url: #{exc}"

      else
        error "websocket error: #{exc}"
      end
    end
def on_error(exc)
      case exc
      when Kontena::Websocket::SSLVerifyError
        if exc.cert
          error "unable to connect to SSL server with KONTENA_SSL_VERIFY=true: #{exc} (subject #{exc.subject}, issuer #{exc.issuer})"
        else
          error "unable to connect to SSL server with KONTENA_SSL_VERIFY=true: #{exc}"
        end

      when Kontena::Websocket::SSLConnectError
        error "unable to connect to SSL server: #{exc}"

      when Kontena::Websocket::ConnectError
        error "unable to connect to server: #{exc}"

      when Kontena::Websocket::ProtocolError
        error "unexpected response from server, check url: #{exc}"

      else
        error "websocket error: #{exc}"
      end
    end
Websocket connection failed

 @param exc [Kontena::Websocket::Error]