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._BaseExceptionnow.
-
exception
icat.exception._BaseException(*args)¶ Bases:
ExceptionAn 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._BaseExceptionErrors raised by either the ICAT or the IDS server.
This is the common base class for
icat.exception.ICATErrorandicat.exception.IDSError, it is not intented to be raised directly.
-
exception
icat.exception.ICATError(error, status=None)¶ Bases:
icat.exception.ServerErrorBase class for the errors raised by the ICAT server.
-
exception
icat.exception.ICATParameterError(error, status=None)¶ Bases:
icat.exception.ICATErrorGenerally indicates a problem with the arguments made to a call.
-
exception
icat.exception.ICATInternalError(error, status=None)¶ Bases:
icat.exception.ICATErrorMay be caused by network problems, database problems, GlassFish problems or bugs in ICAT.
-
exception
icat.exception.ICATPrivilegesError(error, status=None)¶ Bases:
icat.exception.ICATErrorIndicates that the authorization rules have not matched your request.
-
exception
icat.exception.ICATNoObjectError(error, status=None)¶ Bases:
icat.exception.ICATErrorIs thrown when something is not found.
-
exception
icat.exception.ICATObjectExistsError(error, status=None)¶ Bases:
icat.exception.ICATErrorIs 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.ICATErrorIs 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.ICATErrorMarks 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.ServerErrorBase class for the errors raised by the IDS server.
-
exception
icat.exception.IDSBadRequestError(error, status=None)¶ Bases:
icat.exception.IDSErrorAny kind of bad input parameter.
-
exception
icat.exception.IDSDataNotOnlineError(error, status=None)¶ Bases:
icat.exception.IDSErrorThe requested data are not on line.
-
exception
icat.exception.IDSInsufficientPrivilegesError(error, status=None)¶ Bases:
icat.exception.IDSErrorYou are denied access to the data.
-
exception
icat.exception.IDSInsufficientStorageError(error, status=None)¶ Bases:
icat.exception.IDSErrorThere is not sufficient physical storage or you have exceeded some quota.
-
exception
icat.exception.IDSInternalError(error, status=None)¶ Bases:
icat.exception.IDSErrorSome kind of failure in the server or in communicating with the server.
-
exception
icat.exception.IDSNotFoundError(error, status=None)¶ Bases:
icat.exception.IDSErrorThe requested data do not exist.
-
exception
icat.exception.IDSNotImplementedError(error, status=None)¶ Bases:
icat.exception.IDSErrorUse 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._BaseExceptionAn error that reveals a bug in python-icat.
-
exception
icat.exception.ConfigError(*args)¶ Bases:
icat.exception._BaseExceptionError getting configuration options.
-
exception
icat.exception.QueryNullableOrderWarning(attr)¶ Bases:
WarningWarn about using a nullable relation for ordering.
-
exception
icat.exception.ClientVersionWarning(version=None, comment=None)¶ Bases:
WarningWarn that the version of the ICAT server is not supported by the client.
-
exception
icat.exception.ICATDeprecationWarning(feature, version=None)¶ Bases:
DeprecationWarningWarn about using an API feature that may get removed in future ICAT server versions.
-
exception
icat.exception.EntityTypeError(*args)¶ Bases:
icat.exception._BaseException,TypeErrorAn invalid entity type has been used.
Changed in version 0.18.0: Inherit from
TypeError.
-
exception
icat.exception.VersionMethodError(method, version=None, service='ICAT')¶ Bases:
icat.exception._BaseExceptionCall of an API method that is not supported in the version of the server.
-
exception
icat.exception.SearchResultError(*args)¶ Bases:
icat.exception._BaseExceptionA search result does not conform to what should have been expected.
-
exception
icat.exception.SearchAssertionError(query, assertmin, assertmax, num)¶ Bases:
icat.exception.SearchResultErrorA 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._BaseExceptionSome data is not consistent with rules or constraints.
-
exception
icat.exception.IDSResponseError(*args)¶ Bases:
icat.exception._BaseExceptionThe response from the IDS was not what should have been expected.
-
exception
icat.exception.GenealogyError(*args)¶ Bases:
icat.exception._BaseExceptionError in the genealogy of entity types.
Deprecated since version 0.17: Only used in
icat.icatcheckwhich 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
+-- TypeError
| +-- EntityTypeError
+-- VersionMethodError
+-- SearchResultError
| +-- SearchAssertionError
+-- DataConsistencyError
+-- IDSResponseError
+-- GenealogyError
+-- Warning
+-- QueryNullableOrderWarning
+-- ClientVersionWarning
+-- DeprecationWarning
+-- ICATDeprecationWarning
Here, Exception, TypeError, Warning, and
DeprecationWarning are build-in exceptions from the Python
standard library.