Skip to content

Exceptions

These are all the custom exceptions you might encounter when using iCal-library.

CalendarParentRelationError

Bases: ValueError

Indicate finding the tree root failed as it did not find a VCalendar root.

Source code in ical_library/exceptions.py
 7
 8
 9
10
class CalendarParentRelationError(ValueError):
    """Indicate finding the tree root failed as it did not find a VCalendar root."""

    pass

VEventExpansionFailed

Bases: ValueError

Indicate the expansion based on recurring properties failed.

Source code in ical_library/exceptions.py
13
14
15
16
class VEventExpansionFailed(ValueError):
    """Indicate the expansion based on recurring properties failed."""

    pass

MissingRequiredProperty

Bases: ValueError

Indicate a required property is not set for a Component.

Source code in ical_library/exceptions.py
19
20
21
22
23
24
25
26
27
28
29
30
31
class MissingRequiredProperty(ValueError):
    """Indicate a required property is not set for a Component."""

    def __init__(self, component: "Component", missing_property_name: str):
        self.component = component
        self.missing_property_name = missing_property_name

    def __repr__(self) -> str:
        """Overwrite the repr to create a better representation for the item."""
        return (
            f"The required property named {self.missing_property_name} was not set for "
            f"{self.component.__class__.__name__}"
        )