BrianObjectException class

(Shortest import: from brian2 import BrianObjectException)

class brian2.core.base.BrianObjectException(message, brianobj, original_exception)[source]

Bases: exceptions.Exception

High level exception that adds extra Brian-specific information to exceptions

This exception should only be raised at a fairly high level in Brian code to pass information back to the user. It adds extra information about where a BrianObject was defined to better enable users to locate the source of problems.

You should use the brian_object_exception() function to raise this, and it should only be raised in an except block handling a prior exception.

Parameters:

message : str

Additional error information to add to the original exception.

brianobj : BrianObject

The object that caused the error to happen.

original_exception : Exception

The original exception that was raised.