Skip to content

Exceptions

pyslurm.PyslurmError

Bases: Exception

The base Exception for all Pyslurm errors.

pyslurm.RPCError

Bases: PyslurmError

Exception for handling Slurm RPC errors.

Parameters:

Name Type Description Default
errno int

A slurm error number returned by RPC functions. Default is None, which will get the last slurm error automatically.

-1
msg str

An optional, custom error description. If this is set, the errno will not be translated to its string representation.

None

Examples:

>>> import pyslurm
... try:
...     myjob = pyslurm.Job.load(9999)
... except pyslurm.RPCError as e:
...     print("Loading the Job failed")