Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle alembic command error. #407

Merged
merged 1 commit into from
Oct 20, 2016
Merged

Conversation

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Oct 16, 2016

Handle alembic command error. Fixes #384.

@@ -96,6 +97,9 @@ 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(str(cerr))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the code review feedback we should provide more user friendly error messages not just printing out the message from the exception. These error messages will be read by our users who might not be familiar with SQLAlchemy or Alembic errors.
I try to improve it in any new improvement and update our existing source too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -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.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message can be a bit misleading, because in the issue description the problem is if there is a newer schema in the database and we want to connect to it with an older CodeChecker.
In that case no schema update or creation is done. Might be useful to to print out here that there is a database incompatibility between the used CodeChecker version and the database, and updating your CodeChecker release to a newer should resolve it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@gyorb gyorb merged commit 17cb88f into Ericsson:master Oct 20, 2016
@Xazax-hun Xazax-hun deleted the CommandError branch July 31, 2017 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants