Skip to content

Commit

Permalink
Merge pull request #407 from Xazax-hun/CommandError
Browse files Browse the repository at this point in the history
Handle alembic command error.
  • Loading branch information
gyorb authored Oct 20, 2016
2 parents 3fc18a9 + 7fbabcc commit 17cb88f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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,11 @@ 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("Database schema and CodeChecker is incompatible."
"Please update CodeChecker.")
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 17cb88f

Please sign in to comment.