icat.exception
— Exception handling¶
This module defines Python counterparts of the exceptions raised by ICAT or IDS server, as well as exceptions raised in python-icat.
Helper¶
-
icat.exception.
stripCause
(e)¶ Try to suppress misleading context from an exception.
Deprecated since version 0.14.0: Not needed any more, embedded in
icat.exception._BaseException
now.
-
exception
icat.exception.
_BaseException
(*args)¶ Bases:
Exception
An exception that tries to suppress misleading context.
Exception Chaining and Embedded Tracebacks has been introduced with Python 3. Unfortunately the result is completely misleading most of the times. This class tries to strip the context from the exception traceback.
This is the common base class for for all exceptions defined in
icat.exception
, it is not intented to be raised directly.
Exceptions raised by the ICAT or IDS server¶
-
exception
icat.exception.
ServerError
(error, status=None)¶ Bases:
icat.exception._BaseException
Errors raised by either the ICAT or the IDS server.
This is the common base class for
icat.exception.ICATError
andicat.exception.IDSError
, it is not intented to be raised directly.
-
exception
icat.exception.
ICATError
(error, status=None)¶ Bases:
icat.exception.ServerError
Base class for the errors raised by the ICAT server.
-
exception
icat.exception.
ICATParameterError
(error, status=None)¶ Bases:
icat.exception.ICATError
Generally indicates a problem with the arguments made to a call.
-
exception
icat.exception.
ICATInternalError
(error, status=None)¶ Bases:
icat.exception.ICATError
May be caused by network problems, database problems, GlassFish problems or bugs in ICAT.
-
exception
icat.exception.
ICATPrivilegesError
(error, status=None)¶ Bases:
icat.exception.ICATError
Indicates that the authorization rules have not matched your request.
-
exception
icat.exception.
ICATNoObjectError
(error, status=None)¶ Bases:
icat.exception.ICATError
Is thrown when something is not found.
-
exception
icat.exception.
ICATObjectExistsError
(error, status=None)¶ Bases:
icat.exception.ICATError
Is thrown when trying to create something but there is already one with the same values of the constraint fields.
-
exception
icat.exception.
ICATSessionError
(error, status=None)¶ Bases:
icat.exception.ICATError
Is used when the sessionId you have passed into a call is not valid or if you are unable to authenticate.
-
exception
icat.exception.
ICATValidationError
(error, status=None)¶ Bases:
icat.exception.ICATError
Marks an exception which was thrown instead of placing the database in an invalid state.
-
exception
icat.exception.
ICATNotImplementedError
(error, status=None)¶ Bases:
icat.exception.ICATError
-
exception
icat.exception.
IDSError
(error, status=None)¶ Bases:
icat.exception.ServerError
Base class for the errors raised by the IDS server.
-
exception
icat.exception.
IDSBadRequestError
(error, status=None)¶ Bases:
icat.exception.IDSError
Any kind of bad input parameter.
-
exception
icat.exception.
IDSDataNotOnlineError
(error, status=None)¶ Bases:
icat.exception.IDSError
The requested data are not on line.
-
exception
icat.exception.
IDSInsufficientPrivilegesError
(error, status=None)¶ Bases:
icat.exception.IDSError
You are denied access to the data.
-
exception
icat.exception.
IDSInsufficientStorageError
(error, status=None)¶ Bases:
icat.exception.IDSError
There is not sufficient physical storage or you have exceeded some quota.
-
exception
icat.exception.
IDSInternalError
(error, status=None)¶ Bases:
icat.exception.IDSError
Some kind of failure in the server or in communicating with the server.
-
exception
icat.exception.
IDSNotFoundError
(error, status=None)¶ Bases:
icat.exception.IDSError
The requested data do not exist.
-
exception
icat.exception.
IDSNotImplementedError
(error, status=None)¶ Bases:
icat.exception.IDSError
Use of some functionality that is not supported by the implementation.
-
icat.exception.
translateError
(error, status=None, server='ICAT')¶ Translate an error from ICAT or IDS to the corresponding exception.
Exceptions raised by python-icat¶
-
exception
icat.exception.
InternalError
(*args)¶ Bases:
icat.exception._BaseException
An error that reveals a bug in python-icat.
-
exception
icat.exception.
ConfigError
(*args)¶ Bases:
icat.exception._BaseException
Error getting configuration options.
-
exception
icat.exception.
QueryNullableOrderWarning
(attr)¶ Bases:
Warning
Warn about using a nullable relation for ordering.
-
exception
icat.exception.
ClientVersionWarning
(version=None, comment=None)¶ Bases:
Warning
Warn that the version of the ICAT server is not supported by the client.
-
exception
icat.exception.
ICATDeprecationWarning
(feature, version=None)¶ Bases:
DeprecationWarning
Warn about using an API feature that may get removed in future ICAT server versions.
-
exception
icat.exception.
EntityTypeError
(*args)¶ Bases:
icat.exception._BaseException
An invalid entity type has been used.
-
exception
icat.exception.
VersionMethodError
(method, version=None, service='ICAT')¶ Bases:
icat.exception._BaseException
Call of an API method that is not supported in the version of the server.
-
exception
icat.exception.
SearchResultError
(*args)¶ Bases:
icat.exception._BaseException
A search result does not conform to what should have been expected.
-
exception
icat.exception.
SearchAssertionError
(query, assertmin, assertmax, num)¶ Bases:
icat.exception.SearchResultError
A search result does not conform to an assertion.
This exception is thrown when the number of objects found on a search does not lie within the bounds of an assertion, see
icat.client.Client.assertedSearch()
.
-
exception
icat.exception.
DataConsistencyError
(*args)¶ Bases:
icat.exception._BaseException
Some data is not consistent with rules or constraints.
-
exception
icat.exception.
IDSResponseError
(*args)¶ Bases:
icat.exception._BaseException
The response from the IDS was not what should have been expected.
-
exception
icat.exception.
GenealogyError
(*args)¶ Bases:
icat.exception._BaseException
Error in the genealogy of entity types.
Deprecated since version 0.17: Only used in
icat.icatcheck
which in turn is deprecated.
Exception hierarchy¶
The class hierarchy for the exceptions is:
Exception
+-- ServerError
| +-- ICATError
| | +-- ICATParameterError
| | +-- ICATInternalError
| | +-- ICATPrivilegesError
| | +-- ICATNoObjectError
| | +-- ICATObjectExistsError
| | +-- ICATSessionError
| | +-- ICATValidationError
| | +-- ICATNotImplementedError
| +-- IDSError
| +-- IDSBadRequestError
| +-- IDSDataNotOnlineError
| +-- IDSInsufficientPrivilegesError
| +-- IDSInsufficientStorageError
| +-- IDSInternalError
| +-- IDSNotFoundError
| +-- IDSNotImplementedError
+-- InternalError
+-- ConfigError
+-- EntityTypeError
+-- VersionMethodError
+-- SearchResultError
| +-- SearchAssertionError
+-- DataConsistencyError
+-- IDSResponseError
+-- GenealogyError
+-- Warning
+-- QueryNullableOrderWarning
+-- ClientVersionWarning
+-- DeprecationWarning
+-- ICATDeprecationWarning
Here, Exception
, Warning
, and DeprecationWarning
are build-in exceptions from the Python standard library.