Files
AI/참고/guardrails-main/guardrails/errors/__init__.py
2026-05-12 19:40:31 +09:00

23 lines
568 B
Python

class ValidationError(Exception):
"""Top level validation error.
This is thrown from the validation engine when a Validator has
on_fail=OnFailActions.EXCEPTION set and validation fails.
Inherits from Exception.
"""
class UserFacingException(Exception):
"""Wraps an exception to denote it as user-facing.
It will be unwrapped in runner.
"""
def __init__(self, original_exception: Exception):
super().__init__()
self.original_exception = original_exception
__all__ = ["ValidationError", "UserFacingException"]