"""Typed exception for Langfuse operation failures."""

from __future__ import annotations

from dr_langfuse.errors.error_envelope import ErrorEnvelope


class LangfuseError(Exception):
    """Raised when a Langfuse operation fails with a typed error envelope."""

    def __init__(self, error: ErrorEnvelope) -> None:
        super().__init__(error.message)
        self.error = error
