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

fix: Raise error if waved cannot find public/private dir #2130 #2213

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

92ammarraza
Copy link

The PR fulfills these requirements: (check all the apply)

  • It's submitted to the main branch.
  • When resolving a specific issue, it's referenced in the PR's title (e.g. feat: Add a button #xxx, where "xxx" is the issue number).
  • When resolving a specific issue, the PR description includes Closes #xxx, where "xxx" is the issue number.
  • If changes were made to ui folder, unit tests (make test) still pass.
  • New/updated tests are included

Related issue #2130

Overview:
This pull request addresses the issue #2130 , where waved would start without error even if the specified public/private directories were missing or incorrectly configured. The changes introduce error checking during server startup to ensure these directories exist and are accessible.

Changes:

  • Added a checkDirectory function in server.go to validate the existence of public and private directories.
  • Integrated directory checks during the server initialization phase.
  • Server now fails to start with a clear error message if either directory is missing or inaccessible.

Testing

  • Tested server startup with current directory paths, an error message is seen on the terminal.
Screenshot 2023-12-06 at 2 37 48 PM

Closes #2130

Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

Thanks @92ammarraza! A small refactor needed and should be good to go.

server.go Outdated Show resolved Hide resolved
server.go Outdated Show resolved Hide resolved
@mturoci
Copy link
Collaborator

mturoci commented Dec 8, 2023

Hey @92ammarraza. Make sure the comments are addressed in the correct branch. File changes view doesn't show your latest changes.

@92ammarraza
Copy link
Author

Hey @mturoci , Me and @johnmrzo are working together in team on this for a class. He has pushed the latest changes. Looking forward to your feedback.

Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

Please make sure you test your code and it works correctly. It does not at the moment. An err is thrown even for valid directories.

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.

Raise error if waved cannot find public/private dir
3 participants