Skip to content

Commit

Permalink
Add missing DatabaseError definition
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-yao authored and highker committed Dec 28, 2017
1 parent 27b0495 commit 4bccbda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions prestodb/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class PrestoError(Exception):
pass


class DatabaseError(Exception):
pass


class PrestoQueryError(Exception):
def __init__(self, error):
self._error = error
Expand Down
4 changes: 2 additions & 2 deletions prestodb/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def commit(self):
try:
list(query.execute())
except Exception as err:
raise prestodb.exceptions.DatabaseErrror(
raise prestodb.exceptions.DatabaseError(
'failed to commit transaction {}: {}'.format(self._id, err))

def rollback(self):
Expand All @@ -104,5 +104,5 @@ def rollback(self):
try:
list(query.execute())
except Exception as err:
raise prestodb.exceptions.DatabaseErrror(
raise prestodb.exceptions.DatabaseError(
'failed to rollback transaction {}: {}'.format(self._id, err))

0 comments on commit 4bccbda

Please sign in to comment.