weaver.owsexceptions
¶
Exceptions are based on pyramid.httpexceptions
and pywps.exceptions
to handle more cases where they can
be caught whether the running process is via weaver
or through pywps
service.
Furthermore, interrelation with weaver.exceptions
classes (with base
:exception:`weaver.exceptions.WeaverException`) also employ specific :exception:`OWSExceptions` definitions to provide
specific error details.
Module Contents¶
-
exception
weaver.owsexceptions.
OWSException
(detail=None, value=None, **kw)[source]¶ Represents a WSGI response.
If no arguments are passed, creates a
Response
that uses a variety of defaults. The defaults may be changed by sub-classing theResponse
. See the sub-classing notes.- Variables
body (bytes or text_type) – If
body
is atext_type
, then it will be encoded using eithercharset
when provided ordefault_encoding
whencharset
is not provided if thecontent_type
allows for acharset
. This argument is mutually exclusive withapp_iter
.status (int or str) – Either an
int
or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.headerlist (list) – A list of HTTP headers for the response.
app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with
body
.content_type (str or None) – Sets the
Content-Type
header. If nocontent_type
is provided, and there is noheaderlist
, thedefault_content_type
will be automatically set. Ifheaderlist
is provided then this value is ignored.conditional_response (bool) – Used to change the behavior of the
Response
to check the original request for conditional response headers. Seeconditional_response_app()
for more information.charset (str or None) – Adds a
charset
Content-Type
parameter. If nocharset
is provided and theContent-Type
is text, then thedefault_charset
will automatically be added. Currently the onlyContent-Type
’s that allow for acharset
are defined to betext/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added. If aheaderlist
is provided this value is ignored.
All other response attributes may be set on the response by providing them as keyword arguments. A
TypeError
will be raised for any unexpected keywords.Sub-classing notes:
The
default_content_type
is used as the default for theContent-Type
header that is returned on the response. It istext/html
.The
default_charset
is used as the default character set to return on theContent-Type
header, if theContent-Type
allows for acharset
parameter. Currently the onlyContent-Type
’s that allow for acharset
are defined to be:text/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added.The
unicode_errors
is set tostrict
, and access on atext
will raise an error if it fails to decode thebody
.default_conditional_response
is set toFalse
. This flag may be set toTrue
so that allResponse
objects will attempt to check the original request for conditional response headers. Seeconditional_response_app()
for more information.default_body_encoding
is set to ‘UTF-8’ by default. It exists to allow users to get/set theResponse
object using.text
, even if nocharset
has been set for theContent-Type
.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSAccessForbidden
(*args, **kwargs)[source]¶ Represents a WSGI response.
If no arguments are passed, creates a
Response
that uses a variety of defaults. The defaults may be changed by sub-classing theResponse
. See the sub-classing notes.- Variables
body (bytes or text_type) – If
body
is atext_type
, then it will be encoded using eithercharset
when provided ordefault_encoding
whencharset
is not provided if thecontent_type
allows for acharset
. This argument is mutually exclusive withapp_iter
.status (int or str) – Either an
int
or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.headerlist (list) – A list of HTTP headers for the response.
app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with
body
.content_type (str or None) – Sets the
Content-Type
header. If nocontent_type
is provided, and there is noheaderlist
, thedefault_content_type
will be automatically set. Ifheaderlist
is provided then this value is ignored.conditional_response (bool) – Used to change the behavior of the
Response
to check the original request for conditional response headers. Seeconditional_response_app()
for more information.charset (str or None) – Adds a
charset
Content-Type
parameter. If nocharset
is provided and theContent-Type
is text, then thedefault_charset
will automatically be added. Currently the onlyContent-Type
’s that allow for acharset
are defined to betext/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added. If aheaderlist
is provided this value is ignored.
All other response attributes may be set on the response by providing them as keyword arguments. A
TypeError
will be raised for any unexpected keywords.Sub-classing notes:
The
default_content_type
is used as the default for theContent-Type
header that is returned on the response. It istext/html
.The
default_charset
is used as the default character set to return on theContent-Type
header, if theContent-Type
allows for acharset
parameter. Currently the onlyContent-Type
’s that allow for acharset
are defined to be:text/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added.The
unicode_errors
is set tostrict
, and access on atext
will raise an error if it fails to decode thebody
.default_conditional_response
is set toFalse
. This flag may be set toTrue
so that allResponse
objects will attempt to check the original request for conditional response headers. Seeconditional_response_app()
for more information.default_body_encoding
is set to ‘UTF-8’ by default. It exists to allow users to get/set theResponse
object using.text
, even if nocharset
has been set for theContent-Type
.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSNotFound
(*args, **kwargs)[source]¶ Represents a WSGI response.
If no arguments are passed, creates a
Response
that uses a variety of defaults. The defaults may be changed by sub-classing theResponse
. See the sub-classing notes.- Variables
body (bytes or text_type) – If
body
is atext_type
, then it will be encoded using eithercharset
when provided ordefault_encoding
whencharset
is not provided if thecontent_type
allows for acharset
. This argument is mutually exclusive withapp_iter
.status (int or str) – Either an
int
or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.headerlist (list) – A list of HTTP headers for the response.
app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with
body
.content_type (str or None) – Sets the
Content-Type
header. If nocontent_type
is provided, and there is noheaderlist
, thedefault_content_type
will be automatically set. Ifheaderlist
is provided then this value is ignored.conditional_response (bool) – Used to change the behavior of the
Response
to check the original request for conditional response headers. Seeconditional_response_app()
for more information.charset (str or None) – Adds a
charset
Content-Type
parameter. If nocharset
is provided and theContent-Type
is text, then thedefault_charset
will automatically be added. Currently the onlyContent-Type
’s that allow for acharset
are defined to betext/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added. If aheaderlist
is provided this value is ignored.
All other response attributes may be set on the response by providing them as keyword arguments. A
TypeError
will be raised for any unexpected keywords.Sub-classing notes:
The
default_content_type
is used as the default for theContent-Type
header that is returned on the response. It istext/html
.The
default_charset
is used as the default character set to return on theContent-Type
header, if theContent-Type
allows for acharset
parameter. Currently the onlyContent-Type
’s that allow for acharset
are defined to be:text/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added.The
unicode_errors
is set tostrict
, and access on atext
will raise an error if it fails to decode thebody
.default_conditional_response
is set toFalse
. This flag may be set toTrue
so that allResponse
objects will attempt to check the original request for conditional response headers. Seeconditional_response_app()
for more information.default_body_encoding
is set to ‘UTF-8’ by default. It exists to allow users to get/set theResponse
object using.text
, even if nocharset
has been set for theContent-Type
.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSNotAcceptable
(*args, **kwargs)[source]¶ Represents a WSGI response.
If no arguments are passed, creates a
Response
that uses a variety of defaults. The defaults may be changed by sub-classing theResponse
. See the sub-classing notes.- Variables
body (bytes or text_type) – If
body
is atext_type
, then it will be encoded using eithercharset
when provided ordefault_encoding
whencharset
is not provided if thecontent_type
allows for acharset
. This argument is mutually exclusive withapp_iter
.status (int or str) – Either an
int
or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.headerlist (list) – A list of HTTP headers for the response.
app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with
body
.content_type (str or None) – Sets the
Content-Type
header. If nocontent_type
is provided, and there is noheaderlist
, thedefault_content_type
will be automatically set. Ifheaderlist
is provided then this value is ignored.conditional_response (bool) – Used to change the behavior of the
Response
to check the original request for conditional response headers. Seeconditional_response_app()
for more information.charset (str or None) – Adds a
charset
Content-Type
parameter. If nocharset
is provided and theContent-Type
is text, then thedefault_charset
will automatically be added. Currently the onlyContent-Type
’s that allow for acharset
are defined to betext/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added. If aheaderlist
is provided this value is ignored.
All other response attributes may be set on the response by providing them as keyword arguments. A
TypeError
will be raised for any unexpected keywords.Sub-classing notes:
The
default_content_type
is used as the default for theContent-Type
header that is returned on the response. It istext/html
.The
default_charset
is used as the default character set to return on theContent-Type
header, if theContent-Type
allows for acharset
parameter. Currently the onlyContent-Type
’s that allow for acharset
are defined to be:text/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added.The
unicode_errors
is set tostrict
, and access on atext
will raise an error if it fails to decode thebody
.default_conditional_response
is set toFalse
. This flag may be set toTrue
so that allResponse
objects will attempt to check the original request for conditional response headers. Seeconditional_response_app()
for more information.default_body_encoding
is set to ‘UTF-8’ by default. It exists to allow users to get/set theResponse
object using.text
, even if nocharset
has been set for theContent-Type
.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSNoApplicableCode
(*args, **kwargs)[source]¶ WPS Bad Request Exception.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSMissingParameterValue
(*args, **kwargs)[source]¶ MissingParameterValue WPS Exception.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSInvalidParameterValue
(*args, **kwargs)[source]¶ InvalidParameterValue WPS Exception.
Initialize self. See help(type(self)) for accurate signature.
-
exception
weaver.owsexceptions.
OWSNotImplemented
(*args, **kwargs)[source]¶ Represents a WSGI response.
If no arguments are passed, creates a
Response
that uses a variety of defaults. The defaults may be changed by sub-classing theResponse
. See the sub-classing notes.- Variables
body (bytes or text_type) – If
body
is atext_type
, then it will be encoded using eithercharset
when provided ordefault_encoding
whencharset
is not provided if thecontent_type
allows for acharset
. This argument is mutually exclusive withapp_iter
.status (int or str) – Either an
int
or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.headerlist (list) – A list of HTTP headers for the response.
app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with
body
.content_type (str or None) – Sets the
Content-Type
header. If nocontent_type
is provided, and there is noheaderlist
, thedefault_content_type
will be automatically set. Ifheaderlist
is provided then this value is ignored.conditional_response (bool) – Used to change the behavior of the
Response
to check the original request for conditional response headers. Seeconditional_response_app()
for more information.charset (str or None) – Adds a
charset
Content-Type
parameter. If nocharset
is provided and theContent-Type
is text, then thedefault_charset
will automatically be added. Currently the onlyContent-Type
’s that allow for acharset
are defined to betext/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added. If aheaderlist
is provided this value is ignored.
All other response attributes may be set on the response by providing them as keyword arguments. A
TypeError
will be raised for any unexpected keywords.Sub-classing notes:
The
default_content_type
is used as the default for theContent-Type
header that is returned on the response. It istext/html
.The
default_charset
is used as the default character set to return on theContent-Type
header, if theContent-Type
allows for acharset
parameter. Currently the onlyContent-Type
’s that allow for acharset
are defined to be:text/*
,application/xml
, and*/*+xml
. Any otherContent-Type
’s will not have acharset
added.The
unicode_errors
is set tostrict
, and access on atext
will raise an error if it fails to decode thebody
.default_conditional_response
is set toFalse
. This flag may be set toTrue
so that allResponse
objects will attempt to check the original request for conditional response headers. Seeconditional_response_app()
for more information.default_body_encoding
is set to ‘UTF-8’ by default. It exists to allow users to get/set theResponse
object using.text
, even if nocharset
has been set for theContent-Type
.
Initialize self. See help(type(self)) for accurate signature.