ValidationException Class

Class for all exceptions raised as part of client-side schema validation.

Inheritance
ValidationException

Constructor

ValidationException(message: str, no_personal_data_message: str, *args, error_type: ValidationErrorType = ValidationErrorType.GENERIC, target: ErrorTarget = 'Unknown', error_category: ErrorCategory = 'UserError', **kwargs)

Parameters

Name Description
message
Required
str

A message describing the error. This is the error message the user will see.

no_personal_data_message
Required
str

The error message without any personal data. This will be pushed to telemetry logs.

error_type
Required

The error type, chosen from one of the values of ValidationErrorType enum class.

target
Required

The name of the element that caused the exception to be thrown.

error_category
Required

The error category, defaults to Unknown.

error
Required

The original exception if any.

Keyword-Only Parameters

Name Description
error_type
default value: ValidationErrorType.GENERIC
target
default value: Unknown
error_category
default value: UserError

Methods

add_note

Exception.add_note(note) – add a note to the exception

raise_with_traceback

Raise the exception with the existing traceback.

Deprecated since version 1.22.0: This method is deprecated as we don't support Python 2 anymore. Use raise/from instead.

with_traceback

Exception.with_traceback(tb) – set self.traceback to tb and return self.

add_note

Exception.add_note(note) – add a note to the exception

add_note()

raise_with_traceback

Raise the exception with the existing traceback.

Deprecated since version 1.22.0: This method is deprecated as we don't support Python 2 anymore. Use raise/from instead.

raise_with_traceback() -> None

with_traceback

Exception.with_traceback(tb) – set self.traceback to tb and return self.

with_traceback()

Attributes

args

error_category

Return the error category.

Returns

Type Description

The error category.

error_type

Return the error type.

Returns

Type Description

The error type.

no_personal_data_message

Return the error message with no personal data.

Returns

Type Description
str

No personal data error message.

target

Return the error target.

Returns

Type Description

The error target.

continuation_token

continuation_token: str | None

exc_msg

exc_msg: str

exc_traceback

exc_traceback: TracebackType | None

exc_type

exc_type: Type[Any] | None

exc_value

exc_value: BaseException | None

inner_exception

inner_exception: BaseException | None

message

message: str