Skip to content

A refused c-bind key on <c-slot> or <c-fill> raises RuntimeError instead of VueCodeError #559

Closed

Description

@JuroOravec

Follow-up to #168.

What happens

A c-bind mapping on <c-slot> or <c-fill> that holds a key Vue would read as code, such as ":row" or "v-slot", is refused at render. That part is right. But the render raises a plain RuntimeError. On HTML elements and component tags, the same mistake raises VueCodeError (a TypeError subclass exported from citry), whose docstring promises it for every c-bind key that Vue would read as code.

So code that catches VueCodeError, and any docs that point to it, miss the slot case.

What to do

Raise VueCodeError for these keys on <c-slot> and <c-fill>, keep the message, and add a test for each tag. Check the other raise RuntimeError calls next to it for the same mistake (for example a : prop written with {{ ... }}), and update the VueCodeError docstring if the list of places it covers changes.

Pointers

  • packages/py/citry/citry/nodes/__init__.py, the c-bind handling for <c-slot> (around raise RuntimeError(unsupported)) and for <c-fill>
  • packages/py/citry/citry/attrs.py, class VueCodeError
  • Docs: docs_site/content/vue/slots.md, "Errors when rendering"

Error mode

The render already fails, so nothing reaches the page. Only the exception type changes. Code catching RuntimeError keeps working only if it also catches TypeError, so this needs a changelog line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    v0.9.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions