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¶
-
exception
weaver.exceptions.
WeaverException
[source]¶ Base class of exceptions defined by
weaver
package.Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.exceptions.
InvalidIdentifierValue
[source]¶ Error indicating that an ID to be employed for following operations is not considered as valid to allow further processed or usage.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.exceptions.
MissingIdentifierValue
[source]¶ 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.
-
exception
weaver.exceptions.
ServiceException
[source]¶ Base exception related to a
weaver.datatype.Service
.Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.exceptions.
ServiceNotAccessible
[source]¶ 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
[source]¶ 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
[source]¶ 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
[source]¶ Base exception related to a
weaver.datatype.Process
.Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.exceptions.
ProcessNotAccessible
[source]¶ 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
[source]¶ 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
[source]¶ 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
[source]¶ 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.
-
exception
weaver.exceptions.
JobNotFound
[source]¶ 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.
JobRegistrationError
[source]¶ 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
[source]¶ 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.
-
exception
weaver.exceptions.
PackageTypeError
[source]¶ 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
[source]¶ Error indicating that an instance of
weaver.processes.wps_package.WpsPackage
could not properly be registered for package deployment because of invalid prerequisite.Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.exceptions.
PackageExecutionError
[source]¶ 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
[source]¶ 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
[source]¶ 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.
-
exception
weaver.exceptions.
QuoteNotFound
[source]¶ 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
[source]¶ 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
[source]¶ 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.
-
exception
weaver.exceptions.
BillNotFound
[source]¶ 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
[source]¶ 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
[source]¶ 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 bypywps
.See also
weaver.wps.service.WorkerService
Without prior handling of known internal exception,
pywps
generates by default500
internal server error response since it doesn’t know how to interpret more specific exceptions defined inweaver
.The decorator simply returns the known exception such that
weaver.tweens.ows_response_tween()
can later handle it appropriately. Exceptions derived from :exception:`weaver.owsexceptions.OWSException` are employed since they themselves have base references topywps.exceptions
classes that the service can understand.Warning
In
pywps
,HTTPException
refers to :exception:`werkzeug.exceptions.HTTPException` while inweaver
, it is :exception:`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 that will raise
exception
with specifiedmessage
if an exception is caught while execution the wrapped function, after logging relevant details about the caught exception withlogger
.- 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 raisesHTTPInternalServerError
, unlessexception
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.