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

Replace more generic ValueError with specific FileNotFoundError for warp.sim.load_mesh #291

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

steinraf
Copy link
Contributor

Category

  • New feature
  • Bugfix
  • Breaking change
  • Refactoring
  • Documentation
  • Other

Description

Changing the error type of the warp.sim.load_mesh function for files which don't exist makes it easier to differentiate between wrong paths and invalid meshes programmatically.

Example: Iterating over multiple directories to find a mesh with a given name.

Changelog

Changes
raise ValueError(f"File not found: {filename}")
to
raise FileNotFoundError(f"File not found: {filename}")

Before your PR is "Ready for review"

  • Do you agree to the terms under which contributions are accepted as described in Section 9 the Warp License?
  • Have you read the Contributor Guidelines?
  • Have you written any new necessary tests?
  • Have you added or updated any necessary documentation?
  • Have you added any files modified by compiling Warp and building the documentation to this PR (.e.g. stubs.py, functions.rst)?
  • Does your code pass ruff check and ruff format --check?

@shi-eric
Copy link
Contributor

Thanks for opening this PR!

@shi-eric shi-eric merged commit 5b6f70a into NVIDIA:main Aug 16, 2024
9 checks passed
@steinraf steinraf deleted the steinraf/load_mesh_error_type_change branch August 17, 2024 07:01
@steinraf steinraf restored the steinraf/load_mesh_error_type_change branch August 17, 2024 07:02
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.

2 participants