summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarik Gamble <darik.gamble.spam@gmail.com>2015-10-24 13:43:28 -0400
committerDarik Gamble <darik.gamble@gmail.com>2015-10-28 10:58:27 -0400
commit6df33e959d7c9122e28e5aa6a778b6766feab85f (patch)
treee6fc0f3da86b9941b8096dc8b10634070e777959
parentcccf8e0fac372bd8df658fdd476596968cd31312 (diff)
exception_formatter returns only status, not the entire results tuple
-rwxr-xr-xpgcli/main.py3
-rw-r--r--pgcli/pgexecute.py2
-rw-r--r--tests/conftest.py2
3 files changed, 3 insertions, 4 deletions
diff --git a/pgcli/main.py b/pgcli/main.py
index 173d3eb7..673a42c8 100755
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -619,8 +619,7 @@ def quit_command(sql):
def exception_formatter(e):
- msg = click.style(utf8tounicode(str(e)), fg='red')
- return None, None, None, msg
+ return click.style(utf8tounicode(str(e)), fg='red')
if __name__ == "__main__":
diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py
index 77160f00..326fb123 100644
--- a/pgcli/pgexecute.py
+++ b/pgcli/pgexecute.py
@@ -272,7 +272,7 @@ class PGExecute(object):
# specification
raise
- yield exception_formatter(e)
+ yield None, None, None, exception_formatter(e)
if not on_error_resume:
break
diff --git a/tests/conftest.py b/tests/conftest.py
index 86dc421f..06b61462 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -28,6 +28,6 @@ def executor(connection):
@pytest.fixture
def exception_formatter():
- return lambda e: (None, None, None, str(e))
+ return lambda e: str(e)