INNER CODE UNIT · Python

format_error

fralau/mkdocs-macros-plugin · mkdocs_macros/errors.py:10

def format_error(error: Exception, markdown: str, page: Page) -> str:
    """Default error message for a generic exception."""
    error_type = type(error).__name__
    return textwrap.dedent(
        f'''
        # _Macro Rendering Error_

        _File_: `{page.file.src_path}`
        
        _{error_type}_: {error}
        
        ```
        %s
        ```
        ''',
    ).strip() % traceback.format_exc()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…