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

There's no handling of empty floorplans #2

Open
Victoremepunto opened this issue Oct 15, 2021 · 2 comments
Open

There's no handling of empty floorplans #2

Victoremepunto opened this issue Oct 15, 2021 · 2 comments

Comments

@Victoremepunto
Copy link
Collaborator

The code raises an exception if an empty file is handed as a floorplan:

with open(env['FLOORPLAN_FILE'], 'r') as stream:
         # This try block allows us to proceed if a single SQL query fails
 >       for row in yaml.safe_load(stream):
 E       TypeError: 'NoneType' object is not iterable

There should be a check / better handling of empty files to avoid this type of errors.

Victoremepunto referenced this issue in Victoremepunto/floorist Oct 15, 2021
- Adds the pr_check.sh for running the project required validation checks.
- Adds the test.sh script which contains logic to set up and run integration tests
- Update docker-compose to use Quay repository images
- Updates Dockerfile to add multi-stage builds
- adds build-deploy logic to generate images
- Adds tests to cover #2 and #3
Victoremepunto referenced this issue in Victoremepunto/floorist Oct 15, 2021
- Adds the pr_check.sh for running the project required validation checks.
- Adds the test.sh script which contains logic to set up and run integration tests
- Update docker-compose to use Quay repository images
- Updates Dockerfile to add multi-stage builds
- adds build-deploy logic to generate images
- Adds tests to cover #2 and #3
@skateman
Copy link
Member

What kind of error should we emit? Define "better" please 🤔

@Victoremepunto
Copy link
Collaborator Author

What kind of error should we emit? Define "better" please thinking

This should be handled for example as a ValueError exception, specifically. An empty value is not something we expect from a template so I think this is something we should do. A check on whether if there are no contents before starting to parse the file.

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

No branches or pull requests

2 participants