Skip to content

[SceneLoader] Add a special error message handler for DeprecationWarning#384

Merged
fredroy merged 2 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-add-deprecation-exception-message-in-sceneloader
Apr 3, 2024
Merged

[SceneLoader] Add a special error message handler for DeprecationWarning#384
fredroy merged 2 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-add-deprecation-exception-message-in-sceneloader

Conversation

@damienmarchal
Copy link
Copy Markdown
Contributor

Currently DeprecationWarning exception risen by python code are reported as msg_error()
which is misleading. The PR detect it so it is reported with msg_deprecated()

This is the source of this:
SofaDefrost/STLIB#117

…ionWarning

Otherwise deprecation messages appears as error which is misleading for users.
Copy link
Copy Markdown
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

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

Do we move on with this PR?

Comment thread Plugin/src/SofaPython3/SceneLoaderPY3.cpp
Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
@damienmarchal
Copy link
Copy Markdown
Contributor Author

Yes :)

@hugtalbot hugtalbot changed the title [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning. [SceneLoader] Add a special error message handler for DeprecationWarning. Mar 6, 2024
@hugtalbot hugtalbot changed the title [SceneLoader] Add a special error message handler for DeprecationWarning. [SceneLoader] Add a special error message handler for DeprecationWarning Mar 6, 2024
@hugtalbot
Copy link
Copy Markdown
Contributor

It would be nice, any update @damienmarchal ?

if( py::isinstance(e.type(), py::eval("type(DeprecationWarning)")) )
{
msg_deprecated() << ss.str();
}else
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}else
}
else

{
msg_error() << ss.str();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change

@fredroy fredroy merged commit 32e66f4 into sofa-framework:master Apr 3, 2024
bakpaul pushed a commit to bakpaul/SofaPython3 that referenced this pull request Jun 21, 2024
…ing (sofa-framework#384)

* [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning

Otherwise deprecation messages appears as error which is misleading for users.

* Update Plugin/src/SofaPython3/SceneLoaderPY3.cpp

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>

---------

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
damienmarchal added a commit that referenced this pull request Sep 13, 2024
…ing (#384)

* [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning

Otherwise deprecation messages appears as error which is misleading for users.

* Update Plugin/src/SofaPython3/SceneLoaderPY3.cpp

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>

---------

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr: status ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants