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

Display attribute_error with msg_error #441

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Aug 13, 2024

When using a wrong attribute to an object, the error message is printed with a "Deprecation" status

[DEPRECATED] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/Users/fred/Work/sofa/SofaLnRobotics/scenes/demos/Demo_05_simple_data_inverse.py'.
Python exception:
  AttributeError: Unable to find attribute: EdgeSetTopologyContainer
   You possibly wanted to access:
   - The object named 'EdgeSetTopologyModifier' (80% match)

it seems that the "AttributeError" exception from pybind is also a "DeprecationWarning" apparently ?? 🤔 (according to the test)
so this PR tests if the exception is a DeprecationWarning and NOT an AttributeError to display as "deprecated"

Result:

[ERROR]   [SofaPython3::SceneLoader] Unable to completely load the scene from file '/Users/fred/Work/sofa/SofaLnRobotics/scenes/demos/Demo_05_simple_data_inverse.py'.
Python exception:
  AttributeError: Unable to find attribute: EdgeSetTopologyContainer
   You possibly wanted to access:
   - The object named 'EdgeSetTopologyModifier' (80% match)

@fredroy fredroy force-pushed the attribute_error_as_error branch from 30d2c65 to 3e5a595 Compare August 13, 2024 04:21
@hugtalbot hugtalbot merged commit 9853f11 into sofa-framework:master Aug 14, 2024
1 of 4 checks passed
fredroy added a commit that referenced this pull request Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants