Exception Handling

class pgimp.GimpException.GimpException[source]

Bases: Exception

When pgimp encounters a gimp related exception, it will automatically map it onto GimpException or a subtype so that you can easily handle gimp related errors.


>>> from pgimp.GimpScriptRunner import GimpScriptRunner
>>> try:
...     GimpScriptRunner().execute('1/0')
... except Exception as e:
...     str(e).split('\n')[-2]
'ZeroDivisionError: integer division or modulo by zero'
class pgimp.GimpScriptRunner.GimpNotInstalledException[source]

Bases: pgimp.GimpException.GimpException

Indicates that gimp needs to be installed on the system in order for the software to work.

class pgimp.GimpScriptRunner.GimpScriptException[source]

Bases: pgimp.GimpException.GimpException

Indicates a general error that occurred while trying to execute the script.

class pgimp.GimpScriptRunner.GimpScriptExecutionTimeoutException[source]

Bases: pgimp.GimpException.GimpException

Thrown when the script execution time exceeds the specified timeout.

class pgimp.GimpScriptRunner.GimpUnsupportedOSException[source]

Bases: pgimp.GimpException.GimpException

Indicates that your operating system is not supported.