diff --git a/changelog.md b/changelog.md index 47d16f8f..5098a056 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ Features -------- * Support SSL query parameters on DSNs. +* More information and care on KeyboardInterrupt. Internal -------- diff --git a/mycli/main.py b/mycli/main.py index 5a787988..f29df156 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -774,11 +774,19 @@ def one_iteration(text=None): status_str = str(status).lower() if status_str.find("ok") > -1: logger.debug("cancelled query, connection id: %r, sql: %r", connection_id_to_kill, text) - self.echo("cancelled query", err=True, fg="red") + self.echo(f"Cancelled query id: {connection_id_to_kill}", err=True, fg="blue") + else: + logger.debug( + "Failed to confirm query cancellation, connection id: %r, sql: %r", + connection_id_to_kill, + text, + ) + self.echo(f"Failed to confirm query cancellation, id: {connection_id_to_kill}", err=True, fg="red") except Exception as e: self.echo("Encountered error while cancelling query: {}".format(e), err=True, fg="red") else: logger.debug("Did not get a connection id, skip cancelling query") + self.echo("Did not get a connection id, skip cancelling query", err=True, fg="red") except NotImplementedError: self.echo("Not Yet Implemented.", fg="yellow") except OperationalError as e: