{#-
Method Raises Component

Renders the raises/exceptions section for methods and functions.
Uses safe rendering to handle missing or malformed exception data.
-#}

{% from 'macros/safe_macros.md.jinja2' import safe_section, safe_for, rubric_shell %}

{%- if item.metadata.parsed_doc.raises -%}
{%- call safe_section("method_raises") -%}
{% call rubric_shell() %}
:::{rubric} Raises
:class: rubric-raises
:::
{% endcall %}

{%- call(current_item) safe_for(item.metadata.parsed_doc.raises, "*No exceptions documented.*") -%}
- **`{{- current_item.type | default('Exception') -}}`**{%- if current_item.description -%}: {{- current_item.description -}}{%- endif -%}
{%- endcall -%}
{%- endcall -%}
{%- endif -%}
