Skip to content

errors

errors

Base error classes used in this module.

ParserError

Bases: ValueError

Base class for parser errors.

Exceptions derived from this exception are exclusively raised in PyGerber's Gerber X3 Parser. This exception can be used in try: ... except ParserError: ... block to catch all exceptions raised by Parser while allowing other exceptions to interrupt execution.

Source code in src/pygerber/gerberx3/parser/errors.py
class ParserError(ValueError):
    """Base class for parser errors.

    Exceptions derived from this exception are exclusively raised in PyGerber's Gerber
    X3 Parser. This exception can be used in
    `#!python try: ... except ParserError: ...` block to catch all exceptions
    raised by Parser while allowing other exceptions to interrupt execution.
    """

ZeroOmissionNotSupportedError

Bases: ParserError

Raised when incremental coordinates are selected. (Spec. 8.2.1.2).

Source code in src/pygerber/gerberx3/parser/errors.py
class ZeroOmissionNotSupportedError(ParserError):
    """Raised when incremental coordinates are selected. (Spec. 8.2.1.2)."""

IncrementalCoordinatesNotSupportedError

Bases: ParserError

Raised when incremental coordinates are selected. (Spec. 8.2.1.2).

Source code in src/pygerber/gerberx3/parser/errors.py
class IncrementalCoordinatesNotSupportedError(ParserError):
    """Raised when incremental coordinates are selected. (Spec. 8.2.1.2)."""

UnsupportedCoordinateTypeError

Bases: ParserError

Raised for unsupported coordinate types.

Source code in src/pygerber/gerberx3/parser/errors.py
class UnsupportedCoordinateTypeError(ParserError):
    """Raised for unsupported coordinate types."""

InvalidCoordinateLengthError

Bases: ParserError

Raised when coordinate string is too long.

Source code in src/pygerber/gerberx3/parser/errors.py
class InvalidCoordinateLengthError(ParserError):
    """Raised when coordinate string is too long."""

ParserFatalError

Bases: ParserError

Raised when parser encounters fatal failure from non-parser specific exception.

Source code in src/pygerber/gerberx3/parser/errors.py
class ParserFatalError(ParserError):
    """Raised when parser encounters fatal failure from non-parser specific
    exception.
    """

OnUpdateDrawingStateError

Bases: ParserError

Raised when parser encounters fatal failure from non-parser specific exception during call to .update_drawing_state() call.

Source code in src/pygerber/gerberx3/parser/errors.py
class OnUpdateDrawingStateError(ParserError):
    """Raised when parser encounters fatal failure from non-parser specific
    exception during call to .update_drawing_state() call.
    """

UnitNotSetError

Bases: ParserError

Raised when operation which requires units to be set is executed before units are set.

Source code in src/pygerber/gerberx3/parser/errors.py
class UnitNotSetError(ParserError):
    """Raised when operation which requires units to be set is executed before units
    are set.
    """

ApertureNotDefinedError

Bases: ParserError

Raised when undefined aperture is selected.

Source code in src/pygerber/gerberx3/parser/errors.py
class ApertureNotDefinedError(ParserError):
    """Raised when undefined aperture is selected."""

CoordinateFormatNotSetError

Bases: ParserError

Raised when coordinate parser is requested before coordinate format was set.

Source code in src/pygerber/gerberx3/parser/errors.py
class CoordinateFormatNotSetError(ParserError):
    """Raised when coordinate parser is requested before coordinate format was set."""

ApertureNotSelectedError

Bases: ParserError

Raised when attempting to use aperture without selecting it first.

Source code in src/pygerber/gerberx3/parser/errors.py
class ApertureNotSelectedError(ParserError):
    """Raised when attempting to use aperture without selecting it first."""

ExitParsingProcessInterrupt

Bases: Exception

Raised to stop parsing.

Source code in src/pygerber/gerberx3/parser/errors.py
class ExitParsingProcessInterrupt(Exception):  # noqa: N818
    """Raised to stop parsing."""