Skip to content
New issue

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

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

Already on GitHub? # to your account

Potentially confusing error when view definition file doesn't exist #343

Open
derekprior opened this issue Dec 16, 2021 · 0 comments
Open

Comments

@derekprior
Copy link
Contributor

I ran a scenic migration for a file that doesn't yet exist and was greeted with this:

== 20211216184824 CreateSearches: migrating ===================================
-- create_view(:searches)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

No such file or directory @ rb_sysopen - /Users/derek/src/scenic-views/blog/db/views/app_searches_v01.sql
/Users/derek/src/scenic-views/scenic/lib/scenic/definition.rb:10:in `read'
/Users/derek/src/scenic-views/scenic/lib/scenic/definition.rb:10:in `to_sql'
/Users/derek/src/scenic-views/scenic/lib/scenic/statements.rb:152:in `definition'
/Users/derek/src/scenic-views/scenic/lib/scenic/statements.rb:37:in `create_view'
/Users/derek/src/scenic-views/blog/db/migrate/20211216184824_create_searches.rb:3:in `change'

Caused by:
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/derek/src/scenic-views/blog/db/views/app_searches_v01.sql
/Users/derek/src/scenic-views/scenic/lib/scenic/definition.rb:10:in `read'
/Users/derek/src/scenic-views/scenic/lib/scenic/definition.rb:10:in `to_sql'
/Users/derek/src/scenic-views/scenic/lib/scenic/statements.rb:152:in `definition'
/Users/derek/src/scenic-views/scenic/lib/scenic/statements.rb:37:in `create_view'
/Users/derek/src/scenic-views/blog/db/migrate/20211216184824_create_searches.rb:3:in `change'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

We should handle the no such file or directory error and offer something more helpful and less ugly.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant