{ "info": { "author": "Nick Frederick Settje", "author_email": "nsettje@alumni.stanford.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "====\nerrs\n====\n\n\n.. image:: https://img.shields.io/pypi/v/errs.svg\n :target: https://pypi.python.org/pypi/errs\n\n.. image:: https://img.shields.io/travis/nicksettje/errs.svg\n :target: https://travis-ci.org/nicksettje/errs\n\n.. image:: https://codecov.io/gh/nicksettje/errs/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/nicksettje/errs\n\n.. image:: https://readthedocs.org/projects/errs/badge/?version=latest\n :target: https://errs.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n.. image:: https://pyup.io/repos/github/nicksettje/errs/shield.svg\n :target: https://pyup.io/repos/github/nicksettje/errs/\n :alt: Updates\n\n\n\nType-safe error handling for Python.\n\n\n* Free software: MIT license\n* Documentation: https://errs.readthedocs.io.\n\nInstallation\n------------\n`pip install errs`\n\nUsage\n-----\nThe `@errs` decorator marks any function or method that raises an `Exception`. Rather than handling the `Exception` explicitly, we collect the result of the function and then check whether an error occurred. \n\nThis leads to code that is more explicit about error handling as well as resilient to the raising of unforeseen exceptions. This style is similar to error handling in Go.\n\nAdditionally, all exceptions wrapped by `@errs` will be logged to the default Python logger on the error level. This provides a powerful abstraction where runtime behaviors are logged and separated from current application state.\n\n.. code-block:: python\n\n from errs import errs\n\n @errs\n def raises(): #type: () -> int\n raise Exception('this will get logged')\n return 0\n\n def check_error(): #type: () -> None\n out, err = raises()\n print('Error: {err}'.format(err.check()))\n\n if __name__ == '__main__':\n check_error() #prints Error: True\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2018-12-30)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nicksettje/errs", "keywords": "errs", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "errs", "package_url": "https://pypi.org/project/errs/", "platform": "", "project_url": "https://pypi.org/project/errs/", "project_urls": { "Homepage": "https://github.com/nicksettje/errs" }, "release_url": "https://pypi.org/project/errs/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Type-safe error handling for Python.", "version": "0.1.1" }, "last_serial": 4646655, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "69dffc33f2dae925a0c89fd80b37969f", "sha256": "7aae2b0ac5233961a5aff64ae69c527d7d64159a075170a7750f004299bbb9d6" }, "downloads": -1, "filename": "errs-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69dffc33f2dae925a0c89fd80b37969f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4543, "upload_time": "2018-12-30T17:31:41", "url": "https://files.pythonhosted.org/packages/c6/23/ecb1c6bf065ce316b122bc152e0f1998516d98e729370388d5788e3fac25/errs-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2b36dfa58108c5b870dd10f3e69f86c6", "sha256": "e88f2bf2baf54fed3226a50b8df04ca51c759ae45d9659ccc2ed4a193bc62954" }, "downloads": -1, "filename": "errs-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2b36dfa58108c5b870dd10f3e69f86c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9295, "upload_time": "2018-12-30T17:31:43", "url": "https://files.pythonhosted.org/packages/eb/62/3090db52875d33c816939151d25c6209c9dac8bfced8be1725dc2d1ff380/errs-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "69dffc33f2dae925a0c89fd80b37969f", "sha256": "7aae2b0ac5233961a5aff64ae69c527d7d64159a075170a7750f004299bbb9d6" }, "downloads": -1, "filename": "errs-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69dffc33f2dae925a0c89fd80b37969f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4543, "upload_time": "2018-12-30T17:31:41", "url": "https://files.pythonhosted.org/packages/c6/23/ecb1c6bf065ce316b122bc152e0f1998516d98e729370388d5788e3fac25/errs-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2b36dfa58108c5b870dd10f3e69f86c6", "sha256": "e88f2bf2baf54fed3226a50b8df04ca51c759ae45d9659ccc2ed4a193bc62954" }, "downloads": -1, "filename": "errs-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2b36dfa58108c5b870dd10f3e69f86c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9295, "upload_time": "2018-12-30T17:31:43", "url": "https://files.pythonhosted.org/packages/eb/62/3090db52875d33c816939151d25c6209c9dac8bfced8be1725dc2d1ff380/errs-0.1.1.tar.gz" } ] }