grass.exceptions package

GRASS GIS interface to Python exceptions

exception grass.exceptions.CalledModuleError(module, code, returncode, errors=None)[source]

Bases: subprocess.CalledProcessError

Raised when a called module ends with error (non-zero return code)

Used for failures of modules called as subprocesses from Python code.

Create an exception with a full error message based on the parameters.

Parameters
  • module – module name

  • code – some code snipped which contains parameters

  • returncode – process returncode (assuming non-zero)

  • errors – errors provided by the module (e.g., stderr)

exception grass.exceptions.DBError[source]

Bases: Exception

exception grass.exceptions.FatalError[source]

Bases: Exception

exception grass.exceptions.FlagError[source]

Bases: Exception

exception grass.exceptions.GrassError[source]

Bases: Exception

exception grass.exceptions.ImplementationError[source]

Bases: Exception

exception grass.exceptions.OpenError[source]

Bases: Exception

exception grass.exceptions.ParameterError[source]

Bases: Exception

exception grass.exceptions.ScriptError(value)[source]

Bases: Exception

Raised during script execution.

>>> error = ScriptError('My error message!')
>>> error.value

‘My error message!’ >>> print(error) My error message!

exception grass.exceptions.Usage[source]

Bases: Exception