Documentation

arx.exceptions

arx.exceptions

Source: packages/arx/src/arx/exceptions.py

title: Define custom Exceptions to improve error message.

Classes

ArxError(Exception)

title: Base class for expected user-facing Arx failures.
attributes:
  code:
    type: str
  location:
    type: SourceLocation | None

ParserException(ArxError)

title: Handle exceptions for the Parser phase.
attributes:
  code:
    type: str
  location:
    type: SourceLocation | None
  message:
    type: str

Methods

format_message(self, location: SourceLocation | None) -> str
title: Format the parser failure with an optional source location.
parameters:
  location:
    type: SourceLocation | None
returns:
  type: str
attach_location(self, location: SourceLocation) -> ParserException
title: Attach a source-backed location when one is not already set.
parameters:
  location:
    type: SourceLocation
returns:
  type: ParserException

CodeGenException(ArxError)

title: Handle exceptions for the CodeGen phase.
attributes:
  code:
    type: str
  location:
    type: SourceLocation | None

SourceError(ArxError)

title: Handle expected source loading and size failures.
attributes:
  code:
    type: str
  location:
    type: SourceLocation | None

Search documentation

Type to search.