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

Make error more obvious when trying to create record on a missing table #597

Closed
girardinsamuel opened this issue Feb 18, 2022 · 2 comments
Closed
Labels
enhancement A feature that exists, works as intended but needs to be improved

Comments

@girardinsamuel
Copy link
Contributor

For now when we create a record e.g. for a Post model, if the table does not exist yet we have:

AttributeError: class 'Post' has no attribute id. Did you set the primary key correctly on the model using the primary_key attribute?

instead of having the real error which is that table is missing.

@Marlysson
Copy link
Contributor

This could be done in ServeCommand to stop the app of starting when there migrations to be done?

@girardinsamuel
Copy link
Contributor Author

This could be done in ServeCommand to stop the app of starting when there migrations to be done?

I am not sure it would be a good idea to link masonite and masonite-orm this way. Exceptions are fine. It's just the content of the exception that was not the correct one.

But finally right now I can't reproduce the issue..

@josephmancuso josephmancuso added the enhancement A feature that exists, works as intended but needs to be improved label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved
Projects
None yet
Development

No branches or pull requests

3 participants