Exception utils
Imports¶
newrelic_sb_sdk module
from newrelic_sb_sdk.utils.validators import USER_KEY_PATTERNClasses¶
NewRelicError¶
A generic base exception used for errors relating to the New Relic API operations.
class NewRelicError(Exception):
"""Base exception for New Relic API errors."""
passInvalidUserKey¶
Raised when an invalid New Relic user key is provided. Validates against the standard key format pattern.
class InvalidUserKey(ValueError):
"""Exception raised for invalid New Relic user keys."""
def __init__(self, value):
"""Initialize the mapped exception.
Args:
value: The invalid property value configuring the internal boundaries.
"""
self.value = value
super().__init__(
f"The provided key '{self.value}' does not match the "
f"format '{USER_KEY_PATTERN.pattern}'."
)