# 5.1. Errors

class pathvalidate.error.ErrorReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `Enum`

  Validation error reasons.

  FOUND_ABS_PATH = ('PV1200', 'FOUND_ABS_PATH', 'found an absolute path where must be a relative path')
  INVALID_AFTER_SANITIZE = ('PV2000', 'INVALID_AFTER_SANITIZE', 'found invalid value after sanitizing')
  INVALID_CHARACTER = ('PV1100', 'INVALID_CHARACTER', 'invalid characters found')
  INVALID_LENGTH = ('PV1101', 'INVALID_LENGTH', 'found an invalid string length')
  MALFORMED_ABS_PATH = ('PV1201', 'MALFORMED_ABS_PATH', 'found a malformed absolute path')
  NULL_NAME = ('PV1001', 'NULL_NAME', 'the value must not be an empty')
  RESERVED_NAME = ('PV1002', 'RESERVED_NAME', 'found a reserved name by a platform')
  property code: str

    Error code.

    Type:

      str

  property description: str

    Error reason description.

    Type:

      str

Liar od Errors
Code | Name | Description
--- | --- | ---
PV1001 | NULL_NAME | the value must not be an empty
PV1002 | RESERVED_NAME | found a reserved name by a platform
PV1100 | INVALID_CHARACTER | invalid characters found
PV1101 | INVALID_LENGTH | found an invalid string length
PV1200 | FOUND_ABS_PATH | found an absolute path where must be a relative path
PV1201 | MALFORMED_ABS_PATH | found a malformed absolute path
PV2000 | INVALID_AFTER_SANITIZE | found invalid value after sanitizing

exception pathvalidate.error.ValidationError(*args, **kwargs)

  Bases: `ValueError`

  Exception class of validation errors.

  as_slog() → Dict[str, str]

    Return a dictionary representation of the error.

    Returns:

      A dictionary representation of the error.

    Return type:

      Dict[str, str]

  property byte_count: Optional[int]

    Byte count of the path.

    Type:

      Optional[int]

  property description: Optional[str]

    Error description.

    Type:

      Optional[str]

  property fs_encoding: Optional[str]

    File system encoding.

    Type:

      Optional[str]

  property platform: Optional[Platform]

    Platform information.

    Type:

      `Platform`

  property reason: ErrorReason

    The cause of the error.

    Type:

      `ErrorReason`

  property reserved_name: str

    Reserved name.

    Type:

      str

  property reusable_name: Optional[bool]

    Whether the name is reusable or not.

    Type:

      Optional[bool]