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 20, 2016
1 parent 9c9800e commit 7fbabcc
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 7fbabcc

Please sign in to comment.