ngsildclient.api.exceptions#

A module that covers NGSI-LD API exceptions.

When possible, Exceptions are mapped from the API Error Types, and enriched thanks to the ProblemDetails added by the API.

Functions

rfc7807_error_handle(func)

A decorator function to handle enriched Exceptions that accept a ProblemDetails instance.

rfc7807_error_handle_async(func)

A decorator function to handle enriched Exceptions that accept a ProblemDetails instance.

Classes

ProblemDetails(type, title, status, detail)

Exceptions

NgsiAlreadyExistsError(problemdetails)

NgsiApiError

NgsiBadRequestDataError(problemdetails)

NgsiClientTooManyResultsError

NgsiContextBrokerError(problemdetails)

NgsiHttpError(statuscode)

NgsiInternalError(problemdetails)

NgsiInvalidRequestError(problemdetails)

NgsiLdContextNotAvailableError(problemdetails)

NgsiNoMultiTenantSupportError(problemdetails)

NgsiNonexistentTenantError(problemdetails)

NgsiNotConnectedError

NgsiOperationNotSupportedError(problemdetails)

NgsiResourceNotFoundError(problemdetails)

NgsiTooComplexQueryError(problemdetails)

NgsiTooManyResultsError(problemdetails)

exception ngsildclient.api.exceptions.NgsiAlreadyExistsError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiApiError[source]#

Bases: NgsiError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiBadRequestDataError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiClientTooManyResultsError[source]#

Bases: NgsiApiError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiContextBrokerError(problemdetails)[source]#

Bases: NgsiApiError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiHttpError(statuscode)[source]#

Bases: NgsiApiError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiInternalError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiInvalidRequestError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiLdContextNotAvailableError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiNoMultiTenantSupportError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiNonexistentTenantError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiNotConnectedError[source]#

Bases: NgsiApiError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiOperationNotSupportedError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiResourceNotFoundError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiTooComplexQueryError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception ngsildclient.api.exceptions.NgsiTooManyResultsError(problemdetails)[source]#

Bases: NgsiContextBrokerError

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class ngsildclient.api.exceptions.ProblemDetails(type, title, status, detail, instance=None, extension=None)[source]#

Bases: object

ngsildclient.api.exceptions.rfc7807_error_handle(func)[source]#

A decorator function to handle enriched Exceptions that accept a ProblemDetails instance.

See also

api.entities.create, api.entities.retrieve

ngsildclient.api.exceptions.rfc7807_error_handle_async(func)[source]#

A decorator function to handle enriched Exceptions that accept a ProblemDetails instance.

See also

api.entities.create, api.entities.retrieve