3.6. Exception Handling

Todo

Intro to SAGA exception handling.

3.6.1. Exceptions – radical.saga.exceptions

exception radical.saga.exceptions.SagaException(msg, parent=None, api_object=None, from_log=False)[source]

Bases: Exception

The Exception class encapsulates information about error conditions encountered in SAGA.

Additionally to the error message (e.message), the exception also provides a trace to the code location where the error condition got raised (e.traceback).

B{Example}:

try :
    file = saga.filesystem.File ("sftp://comet.xsede.org/tmp/data1.dat")

except saga.Timeout as to :
    # maybe the network is down?
    print("connection timed out")
except saga.Exception as e :
    # something else went wrong
    print("Exception occurred: %s %s" % (e, e.traceback))

There are cases where multiple backends can report errors at the same time. In that case, the radical.saga implementation will collect the exceptions, sort them by their ‘rank’, and return the highest ranked one. All other catched exceptions are available via get_all_exceptions(), or via the exceptions property.

The rank of an exception defines its explicity: in general terms: the higher the rank, the better defined / known is the cause of the problem.

get_message()[source]

Return the exception message as a string. That message is also available via the ‘message’ property.

get_type()[source]

Return the type of the exception as string.

get_object()[source]

Return the object that raised this exception. An object may not always be available – for example, exceptions raised during object creation may not have the option to keep an incomplete object instance around. In those cases, this method will return ‘None’. Either way, the object is also accessible via the ‘object’ property.

get_all_exceptions()[source]
get_all_messages()[source]
get_traceback()[source]
message

Return the exception message as a string. That message is also available via the ‘message’ property.

object

Return the object that raised this exception. An object may not always be available – for example, exceptions raised during object creation may not have the option to keep an incomplete object instance around. In those cases, this method will return ‘None’. Either way, the object is also accessible via the ‘object’ property.

type

Return the type of the exception as string.

exceptions
messages
traceback
exception radical.saga.exceptions.NotImplemented(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, NotImplementedError

radical.saga does not implement this method or class. (rank: 11)

exception radical.saga.exceptions.IncorrectURL(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, ValueError

The given URL could not be interpreted, for example due to an incorrect / unknown schema. (rank: 10)

exception radical.saga.exceptions.BadParameter(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, ValueError

A given parameter is out of bound or ill formatted. (rank: 9)

exception radical.saga.exceptions.AlreadyExists(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, ValueError

The entity to be created already exists. (rank: 8)

exception radical.saga.exceptions.DoesNotExist(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, KeyError

An operation tried to access a non-existing entity. (rank: 7)

exception radical.saga.exceptions.IncorrectState(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

The operation is not allowed on the entity in its current state. (rank: 6)

exception radical.saga.exceptions.PermissionDenied(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

The used identity is not permitted to perform the requested operation. (rank: 5)

exception radical.saga.exceptions.AuthorizationFailed(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

The backend could not establish a valid identity. (rank: 4)

exception radical.saga.exceptions.AuthenticationFailed(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

The backend could not establish a valid identity. (rank: 3)

exception radical.saga.exceptions.Timeout(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

The interaction with the backend times out. (rank: 2)

exception radical.saga.exceptions.NoSuccess(msg, parent=None, api_object=None, from_log=False)[source]

Bases: radical.saga.exceptions.SagaException, RuntimeError

Some other error occurred. (rank: 1)