Exceptions for Gizwits PaaS
Project description
It's Exception lib for Gizwits PaaS Usage.
How to use
requirement
python >= 3
for now.
install
pip install giz-exceptions
config in settings.py
base on Django REST Framework
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'giz_exceptions.handler.custom_handler'
}
usage
from rest_framework.views import APIView
from giz_exceptions.paas import exceptions
class MyView(APIView):
def get(self, request, *args, **kwargs):
...
if not self.request.condition:
raise exceptions.ProductKeyInvalid
# or with detail message
# raise exceptions.ProductKeyInvalid('This required product key')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
giz_exceptions-0.0.8.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for giz_exceptions-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e95b647397bcef6078a91f79fc45d235732e9afcf2b7483c45a7124332f041 |
|
MD5 | 07ea20c7adb160f21996f68d0bf8b715 |
|
BLAKE2b-256 | aca9bfc94296a18338da8e17c67975ebd8d3b15c7fa51eb607a8e0195fe12dfc |