Skip to content

Every warning/error should provide useful context #238

@anselor

Description

@anselor

Warnings/errors with generic messages do not provide context for what in the code caused the error.

Specifically, I ran into it here:

_LOGGER.warning(f"Failed guarded type import with {exc!r}")

I changed that log to also print guarded_code and it helped a lot. But I really think it should reraise the exception with the guarded_code and then catch and log it here with additional context:

_resolve_type_guarded_imports(autodoc_mock_imports, obj)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions