{ "info": { "author": "Alex Carney", "author_email": "alcarneyme@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Documentation", "Topic :: Documentation :: Sphinx", "Topic :: Software Development :: Documentation" ], "description": "Erratum\n=======\n\n.. list-table::\n :stub-columns: 1\n\n * - code\n - |travis| |coveralls|\n * - pypi\n - |version| |py-supported|\n\n.. |version| image:: https://img.shields.io/pypi/v/erratum.svg\n :alt: PyPI Package latest release\n :target: https://pypi.python.org/pypi/erratum\n\n.. |py-supported| image:: https://img.shields.io/pypi/pyversions/erratum.svg\n :alt: Supported versions\n :target: https://pypi.python.org/pypi/erratum\n\n.. |travis| image:: https://travis-ci.org/alcarney/erratum.svg?branch=dev\n :target: https://travis-ci.org/alcarney/erratum\n\n.. |coveralls| image:: https://coveralls.io/repos/github/alcarney/erratum/badge.svg?branch=dev\n :target: https://coveralls.io/github/alcarney/erratum?branch=dev\n\nErratum is a python package that aims to make it easy to build in user friendly\nerror messages into your project. Let's look at the following example:\n\n.. code-block:: python\n\n >>> my_square_root(-1)\n in my_square_root(n)\n 5\n 6 if n < 0:\n ----> 7 raise ValueError(\"You can only take the square root of a positive number\")\n 8\n 9 return math.sqrt(n)\n\n ValueError: You can only take the square root of a positive number\n More info --> https://github.com/alcarney/erratum\n\nAs you can see we get the error message as passed to the exception but we also get\na link to a webpage where we can find more information about the error and what\nwe need to do to fix it.\n\nHow? Well let's look at the implementation of :code:`my_square_root`\n\n.. code-block:: python\n\n import math\n from erratum import Error\n\n class SqrtError(Error):\n url = \"https://github.com/alcarney/erratum\"\n\n @SqrtError\n def my_square_root(n):\n\n if n < 0:\n raise ValueError(\"You can only take the square root of a positive number\")\n\n return math.sqrt(n)\n\nHere we declare our error :code:`SqrtError` by subclassing the :code:`Error` class\nwhich allows us to set the url the user gets sent to find out more about the error.\nThen it is simply of decorating any function we want the function to apply to with\nthe :code:`annotate` method. This will cause any exception that is thrown from within\nthe function to be tagged with the more info link.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "erratum", "package_url": "https://pypi.org/project/erratum/", "platform": "", "project_url": "https://pypi.org/project/erratum/", "project_urls": null, "release_url": "https://pypi.org/project/erratum/0.1.1/", "requires_dist": null, "requires_python": ">=3.0", "summary": "User friendly errors", "version": "0.1.1" }, "last_serial": 3818803, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "35d632acac882bd3b17abce24567ac2a", "sha256": "f06c743d086c1045039417054e844e5110be36698ae8c75bc9f96c0cb5a370fe" }, "downloads": -1, "filename": "erratum-0.0.1.tar.gz", "has_sig": false, "md5_digest": "35d632acac882bd3b17abce24567ac2a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 4088, "upload_time": "2018-04-09T20:09:28", "url": "https://files.pythonhosted.org/packages/46/48/2a1a2f70d82c8c0241c140ddbe51b74cc3ed6935c5983f570938a939f583/erratum-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "594a93c12a92c862fe45be93dcefdaad", "sha256": "1395e752b4bea90d913819d85aa39e420f207045c9e6d022092da5d88055d3cb" }, "downloads": -1, "filename": "erratum-0.1.0.tar.gz", "has_sig": false, "md5_digest": "594a93c12a92c862fe45be93dcefdaad", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 5229, "upload_time": "2018-04-28T18:39:50", "url": "https://files.pythonhosted.org/packages/e4/99/24d89e0491c9d34088b07588eb18d09d2d77436d461359e66d0b54947fba/erratum-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e9f921166b19d3721924f1d1c0ecab57", "sha256": "ff01185b565557d1c9a4a27036cd528178873c4ad7ee7c5532aaceb9cfd88bf3" }, "downloads": -1, "filename": "erratum-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e9f921166b19d3721924f1d1c0ecab57", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 5213, "upload_time": "2018-04-29T14:42:39", "url": "https://files.pythonhosted.org/packages/6b/80/88482789be505975c585ea1f48f30a4a40ef6c812b11ad31a23b4ae0bfa3/erratum-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9f921166b19d3721924f1d1c0ecab57", "sha256": "ff01185b565557d1c9a4a27036cd528178873c4ad7ee7c5532aaceb9cfd88bf3" }, "downloads": -1, "filename": "erratum-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e9f921166b19d3721924f1d1c0ecab57", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 5213, "upload_time": "2018-04-29T14:42:39", "url": "https://files.pythonhosted.org/packages/6b/80/88482789be505975c585ea1f48f30a4a40ef6c812b11ad31a23b4ae0bfa3/erratum-0.1.1.tar.gz" } ] }