Skip to content

Commit

Permalink
Handle alembic command error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazax-hun committed Oct 17, 2016
1 parent 2dcc434 commit 021e0d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions codechecker_lib/database_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from abc import ABCMeta, abstractmethod

import sqlalchemy
from alembic.util import CommandError
from alembic import command, config
from sqlalchemy import event
from sqlalchemy.engine import Engine
Expand Down Expand Up @@ -96,6 +97,10 @@ def _create_or_update_schema(self, use_migration=True):
except sqlalchemy.exc.SQLAlchemyError as alch_err:
LOG.error(str(alch_err))
sys.exit(1)
except CommandError as cerr:
LOG.error("Failed to update or create the database schema.")
LOG.debug(str(cerr))
sys.exit(1)

@abstractmethod
def start(self, db_version_info, wait_for_start=True, init=False):
Expand Down

0 comments on commit 021e0d3

Please sign in to comment.