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

Output stack trace to std::cerr when Python exception is thrown from viewer #168

Merged
merged 2 commits into from
Dec 10, 2022

Conversation

tychuang1211
Copy link
Collaborator

#133

For example:
image

@yungyuc yungyuc added the enhancement New feature or request label Dec 10, 2022
@yungyuc yungyuc self-requested a review December 10, 2022 00:14
Copy link
Member

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

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

LGTM

return *this;
}

// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
int Interpreter::enter_main()
{
// NOLINTNEXTLINE(misc-const-correctness)
pybind11::object mod_sys = pybind11::module_::import("modmesh.system");
int ret = -1;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for using a default return value. It improves readability.

@@ -140,7 +163,7 @@ void Interpreter::preload_module(std::string const & name)
}
catch (const py::error_already_set & e)
{
if (std::string::npos == std::string(e.what()).find("ModuleNotFoundError"))
if (e.matches(PyExc_ModuleNotFoundError))
Copy link
Member

Choose a reason for hiding this comment

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

Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants