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

Improve the error output when newbie user forget settings LUCKY_ENV to production. #1868

Closed
zw963 opened this issue Apr 19, 2024 · 0 comments · Fixed by #1896
Closed

Improve the error output when newbie user forget settings LUCKY_ENV to production. #1868

zw963 opened this issue Apr 19, 2024 · 0 comments · Fixed by #1896
Labels

Comments

@zw963
Copy link

zw963 commented Apr 19, 2024

Describe the bug

When user build a static binary, then copy file into server for deploy, if user no correct setting LUCKY_ENV to production, will get error message like following:

Unhandled exception: Expected config file for the watcher at ./config/watch.yml (Exception)

Which raised from line 20 of config/server.cr. (please check following screenshot)

image

Expected behavior
I consider the better way is, to told user, if forget settings the correct LUCKY_ENV to production?

From the perspective of a new user (it's been a long time since I used Lucky), this is much more useful.

Screenshots/code

root@test1:~/college# bin/college
Unhandled exception: Expected config file for the watcher at ./config/watch.yml (Exception)
  from college/lib/lucky/src/lucky/server_settings.cr:43:7 in 'yaml_settings_file'
  from college/lib/lucky/src/lucky/server_settings.cr:33:33 in 'settings'
  from college/lib/lucky/src/lucky/server_settings.cr:11:25 in 'host'
  from college/config/server.cr:20:21 in '__crystal_main'
  from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:129:5 in 'main_user_code'
  from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:115:7 in 'main'
  from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:141:3 in 'main'

Versions (please complete the following information):

  • Lucky version (check in shard.lock): 1.1.0
  • Crystal version (crystal --version): 1.12.1
  • OS: Arch

Thank you.

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

Successfully merging a pull request may close this issue.

1 participant