weaver.exceptions

Some of these error inherit from weaver.owsexceptions.OWSException and their derived classes to allow pywps to automatically understand and render those exception if raised by an underlying weaver operation.

Module Contents

weaver.exceptions.LOGGER[source]
exception weaver.exceptions.WeaverException[source]

Base class of exceptions defined by weaver package.

Initialize self. See help(type(self)) for accurate signature.

code = 500[source]
title = Internal Server Error[source]
exception weaver.exceptions.InvalidIdentifierValue(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid identifier parameter.

Error indicating that an ID to be employed for following operations is not considered as valid to allow further processing or usage.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
locator = identifier[source]
exception weaver.exceptions.MissingIdentifierValue(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to missing identifier parameter.

Error indicating that an ID to be employed for following operations was missing and cannot continue further processing or usage.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
locator = identifier[source]
exception weaver.exceptions.ServiceException(detail=None, value=None, **kw)[source]

Base exception related to a weaver.datatype.Service.

Initialize self. See help(type(self)) for accurate signature.

locator = service[source]
exception weaver.exceptions.ServiceParsingError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to parsing issue of the reference service definition (incorrectly formed XML/JSON contents).

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceNotAccessible(detail=None, headers=None, comment=None, body_template=None, result=None, **kw)[source]

Error related to forbidden access to a service.

Error indicating that a WPS service exists but is not visible to retrieve from the storage backend of an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to non existant service definition.

Error indicating that an OWS service could not be read from the storage backend by an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a service.

Error indicating that an OWS service could not be registered in the storage backend by an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessException(detail=None, value=None, **kw)[source]

Base exception related to a weaver.datatype.Process.

Initialize self. See help(type(self)) for accurate signature.

locator = process[source]
exception weaver.exceptions.ProcessNotAccessible(detail=None, headers=None, comment=None, body_template=None, result=None, **kw)[source]

Error related to forbidden access to a process.

Error indicating that a local WPS process exists but is not visible to retrieve from the storage backend of an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant process definition.

Error indicating that a local WPS process could not be read from the storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a process.

Error indicating that a WPS process could not be registered in the storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessInstanceError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid process definition.

Error indicating that the process instance passed is not supported with storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobException[source]

Base exception related to a weaver.datatype.Job.

Initialize self. See help(type(self)) for accurate signature.

locator = job[source]
exception weaver.exceptions.JobNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant job definition.

Error indicating that a job could not be read from the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobGone(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to job resource that is gone.

Error indicating that an existing job, although recognized, was dismissed and underlying resources including results are gone.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobInvalidParameter(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid search parameter to filter jobs.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a job.

Error indicating that a job could not be registered in the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobUpdateError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an update issue for a job.

Error indicating that a job could not be updated in the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageException[source]

Base exception related to a weaver.processes.wps_package.Package.

Initialize self. See help(type(self)) for accurate signature.

locator = package[source]
exception weaver.exceptions.PackageTypeError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid package definition.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly parse input/output type(s) for package deployment or execution.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a package.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly be registered for package deployment because of invalid prerequisites.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageExecutionError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a runtime issue during package execution.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly execute the package using provided inputs and package definition.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant package definition.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly retrieve the package definition using provided references.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PayloadNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant deployment payload definition.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly retrieve the package deploy payload using provided references.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteException[source]

Base exception related to a weaver.datatype.Quote.

Initialize self. See help(type(self)) for accurate signature.

locator = quote[source]
exception weaver.exceptions.QuoteNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant quote definition.

Error indicating that a quote could not be read from the storage backend by an instance of weaver.store.QuoteStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid registration issue for a quote.

Error indicating that a quote could not be registered in the storage backend by an instance of weaver.store.QuoteStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteInstanceError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid quote definition.

Error indicating that a given object doesn’t correspond to an expected instance of weaver.datatype.Quote.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillException[source]

Base exception related to a weaver.datatype.Bill.

Initialize self. See help(type(self)) for accurate signature.

locator = bill[source]
exception weaver.exceptions.BillNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non existant bill definition.

Error indicating that a bill could not be read from the storage backend by an instance of weaver.store.BillStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a bill.

Error indicating that a bill could not be registered in the storage backend by an instance of weaver.store.BillStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillInstanceError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid bill definition.

Error indicating that a given object doesn’t correspond to an expected instance of weaver.datatype.Bill.

Initialize self. See help(type(self)) for accurate signature.

weaver.exceptions.handle_known_exceptions(function: Callable[[Any, Any], Any])Callable[source]

Decorator that catches lower-level raised exception that are known to weaver but not by pywps.

See also

weaver.wps.service.WorkerService

Without prior handling of known internal exception, pywps generates by default 500 internal server error response since it doesn’t know how to interpret more specific exceptions defined in weaver.

The decorator simply returns the known exception such that weaver.tweens.ows_response_tween() can later handle it appropriately. Exceptions derived from weaver.owsexceptions.OWSException are employed since they themselves have base references to pywps.exceptions classes that the service can understand.

Warning

In pywps, HTTPException refers to werkzeug.exceptions.HTTPException while in weaver, it is pyramid.httpexceptions.HTTPException. They both offer similar interfaces and functionalities (headers, body, status-code, etc.), but they are not intercepted in the same try/except blocks.

weaver.exceptions.log_unhandled_exceptions(logger: logging.Logger = LOGGER, message: str = 'Unhandled exception occurred.', exception: Type[Exception] = Exception, force: bool = False, require_http: bool = True, is_request: bool = True)Callable[source]

Decorator for logging captured exceptions before re-raise.

Decorator that will raise exception with specified message if an exception is caught while execution the wrapped function, after logging relevant details about the caught exception with logger.

Parameters
  • logger – logger to use for logging (default: use weaver.exception.LOGGER).

  • message – message that will be logged with details and then raised with exception.

  • exception – exception type to be raised instead of the caught exception.

  • force – force handling of any raised exception (default: only known unhandled exceptions are logged).

  • require_http – consider non HTTP-like exceptions as unknown and raise one instead (default: True and raises HTTPInternalServerError, unless exception is HTTP-like).

  • is_request – specifies if the decorator is applied onto a registered request function to handle its inputs.

Raises
  • exception – if an unknown exception was caught (or forced) during the decorated function’s execution.

  • Exception – original exception if it is known.