error module#

Errors and Exceptions#

This module provides exception classes for handling errors during design processing and validation.

exception UserCodeException(message, hint=None)[source]#

Bases: Exception

Exception raised when user code appears to have constructed an invalid design structure.

Parameters:
  • message (str)

  • hint (str | None)

hint: str | None#
exception InstantiationException[source]#

Bases: Exception

This error is raised if an object cannot be instantiated.

exception InvalidElementException(element, path, container)[source]#

Bases: Exception

This error is raised if a “critical” element is encountered in an unexpected place in the design tree. As an example, if we encounter a Pin object is encountered in a Circuit object, this error would be raised. In the best case the element is spurious and could just be ignored as having no effect, but more commonly, this is a mistake and should be corrected thus we treat this as an error.

Parameters:
element: Any#

The encountered element

path: RefPath#

The path where it was encountered

container: Any#

The parent object that contained the element