ds_common_placeholder_py_lib.errors =================================== .. py:module:: ds_common_placeholder_py_lib.errors .. autoapi-nested-parse:: **File:** ``errors.py`` **Region:** ``ds-common-placeholder-py-lib`` Description ----------- Typed errors. A message names the placeholder text and the JSON path, never a resolved value, so it is safe to put in events and logs. Exceptions ---------- .. autoapisummary:: ds_common_placeholder_py_lib.errors.PlaceholderError ds_common_placeholder_py_lib.errors.MissingValue Classes ------- .. autoapisummary:: ds_common_placeholder_py_lib.errors.ErrorCode Module Contents --------------- .. py:class:: ErrorCode Bases: :py:obj:`enum.StrEnum` Stable error codes. Callers map them to failure events. .. py:attribute:: SYNTAX :value: 'syntax' .. py:attribute:: UNKNOWN_NAMESPACE :value: 'unknown_namespace' .. py:attribute:: UNKNOWN_FUNCTION :value: 'unknown_function' .. py:attribute:: ARITY :value: 'arity' .. py:attribute:: ARGUMENT :value: 'argument' .. py:attribute:: MISSING_VALUE :value: 'missing_value' .. py:attribute:: TYPE :value: 'type' .. py:attribute:: SECRET_SCOPE :value: 'secret_scope' .. py:attribute:: SECRET_MISSING :value: 'secret_missing' .. py:attribute:: SECRET_UNAVAILABLE :value: 'secret_unavailable' .. py:attribute:: SQL_POSITION :value: 'sql_position' .. py:attribute:: SQL_SECRET :value: 'sql_secret' .. py:attribute:: PROTECTED_FIELD :value: 'protected_field' .. py:attribute:: CYCLE :value: 'cycle' .. py:exception:: PlaceholderError(code: ErrorCode, message: str, *, path: str = '', placeholder: str | None = None, reference: str | None = None, namespaces: frozenset[str] = frozenset()) Bases: :py:obj:`Exception` A placeholder could not be validated or resolved. :param code: The error code. :param message: What went wrong. Must not contain resolved values. :param path: JSON Pointer of the string that holds the placeholder. :param placeholder: The placeholder text as written in the definition. For a ``syntax`` error it is input text that may be sensitive (an unclosed ``@{`` runs to the end of the string): it is cut to 64 characters, and ``str()`` and ``repr()`` leave it out. :param reference: The reference whose value caused the error, as written (``owner.settings.region``; a whole namespace is its name), when one reference is at fault: its value is missing, ``null`` or blank, of the wrong type, or the namespace is not there. ``None`` when the error is not one reference's (a function's own check, a vault read, every ``coalesce`` argument missing). :param namespaces: The namespaces the part that failed reads: the reference at fault, or the innermost call that failed with everything nested in it, plus the namespace of *reference*. Empty for an error found before anything is read (``syntax``, ``lookup``'s own arguments, a SQL position, a secret call in SQL), and from ``validate``. .. py:attribute:: code .. py:attribute:: message .. py:attribute:: path :value: '' .. py:property:: placeholder :type: str | None The placeholder text; at most 64 characters for ``syntax``. .. py:attribute:: reference :value: None .. py:attribute:: namespaces .. py:exception:: MissingValue Bases: :py:obj:`Exception` Raised by a provider when a path has no value.