Module grpc_argument_validator.argument_validator_config
Expand source code
class ArgumentValidatorConfig:
"""
Global configuration for the argument validator decorator
"""
_use_rich_grpc_errors = False
@classmethod
def set_rich_grpc_errors(cls, enabled: bool = True) -> None:
"""
Set the option to use rich gRPC errors
"""
cls._use_rich_grpc_errors = enabled
@classmethod
def use_rich_grpc_errors(cls) -> bool:
"""
Returns whether or not the option is set to use rich gRPC errors
"""
return cls._use_rich_grpc_errors
Classes
class ArgumentValidatorConfig-
Global configuration for the argument validator decorator
Expand source code
class ArgumentValidatorConfig: """ Global configuration for the argument validator decorator """ _use_rich_grpc_errors = False @classmethod def set_rich_grpc_errors(cls, enabled: bool = True) -> None: """ Set the option to use rich gRPC errors """ cls._use_rich_grpc_errors = enabled @classmethod def use_rich_grpc_errors(cls) -> bool: """ Returns whether or not the option is set to use rich gRPC errors """ return cls._use_rich_grpc_errorsStatic methods
def set_rich_grpc_errors(enabled: bool = True) ‑> None-
Set the option to use rich gRPC errors
Expand source code
@classmethod def set_rich_grpc_errors(cls, enabled: bool = True) -> None: """ Set the option to use rich gRPC errors """ cls._use_rich_grpc_errors = enabled def use_rich_grpc_errors() ‑> bool-
Returns whether or not the option is set to use rich gRPC errors
Expand source code
@classmethod def use_rich_grpc_errors(cls) -> bool: """ Returns whether or not the option is set to use rich gRPC errors """ return cls._use_rich_grpc_errors