Skip to main content

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

giz_exceptions-0.0.8-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file giz_exceptions-0.0.8.tar.gz.

File metadata

  • Download URL: giz_exceptions-0.0.8.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for giz_exceptions-0.0.8.tar.gz
Algorithm Hash digest
SHA256 06ade4ff5a0274a20fb07089f4b7501f9a0caaea2b26599616237bbc9f58263a
MD5 9213c2c9afb0ae9223d3aa555cd0c8e2
BLAKE2b-256 7d9aee71c21ff1eae8a175170782b36e7adbfd44cb499fd4227eb9c9ce34a5fc

See more details on using hashes here.

File details

Details for the file giz_exceptions-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: giz_exceptions-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for giz_exceptions-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e95b647397bcef6078a91f79fc45d235732e9afcf2b7483c45a7124332f041
MD5 07ea20c7adb160f21996f68d0bf8b715
BLAKE2b-256 aca9bfc94296a18338da8e17c67975ebd8d3b15c7fa51eb607a8e0195fe12dfc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page