Skip to content

Explicit and easy-to-understand errors in the annotation directive #173

@markkuriekkinen

Description

@markkuriekkinen

A teacher tried to use the code-block directive inside the annotation directive. The compilation error message about this is not easy to understand and thus, the teacher did not know that the problem stems from the invalid use of the annotation directive. Could the error message be more clear and explicit?

(NB. code-block may be used inside annotated, but not inside annotation that defines the text that is shown during mouse hovering.)

https://github.com/apluslms/a-plus-rst-tools/blob/master/directives/annotated.py
https://github.com/apluslms/a-plus-rst-tools/blob/master/README.md#11-annotated-code-blocks

The confusing error message that the teacher saw was this traceback:

Exception occurred:
  File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 652, in __getitem__
    return self.attributes[key]
KeyError: 'name'

Internal ticket:
https://rt.cs.aalto.fi/Ticket/Display.html?id=24428

Metadata

Metadata

Assignees

No one assigned

    Labels

    requester: Aalto teacherThe issue is raised by a teacher from Aalto Universitytype: bugThis is a bug which is critical for the correct operation of the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions