{ "info": { "author": "Cameron Simpson", "author_email": "cs@cskk.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Convenience facilities for managing exceptions.\n\n## Function `logexc(func)`\n\nDecorator to log exceptions and reraise.\n\n## Function `logexc_gen(genfunc)`\n\nDecorator to log exceptions and reraise for generators.\n\n## Function `LogExceptions(conceal=False)`\n\nWrapper of NoExceptions which reports exceptions and optionally\nsuppresses them.\n\n## Function `noexc(func)`\n\nDecorator to wrap a function which should never raise an exception.\nInstead, any raised exception is attempted to be logged.\n\nA significant side effect is of course that if the function raises an\nexception it now returns None.\nMy primary use case is actually to wrap logging functions,\nwhich I have had abort otherwise sensible code.\n\n## Function `noexc_gen(func)`\n\nDecorator to wrap a generator which should never raise an exception.\nInstead, any raised exception is attempted to be logged and iteration ends.\n\nMy primary use case is wrapping generators chained in a pipeline,\nas in cs.later.Later.pipeline.\n\n## Class `NoExceptions`\n\nA context manager to catch _all_ exceptions and log them.\nArguably this should be a bare try...except but that's syntacticly\nnoisy and separates the catch from the top.\nFor simple function calls return_exc_info() is probably better.\n\n## Function `return_exc_info(func, *args, **kwargs)`\n\nRun the supplied function and arguments.\nReturn `(func_return, None)`\nin the case of successful operation\nand `(None, exc_info)` in the case of an exception.\n\n`exc_info` is a 3-tuple of `(exc_type, exc_value, exc_traceback)`\nas returned by `sys.exc_info()`.\nIf you need to protect a whole suite and would rather not move it\ninto its own function, consider the NoExceptions context manager.\n\n## Function `returns_exc_info(func)`\n\nDecorator function to wrap functions whose exceptions should be caught,\nsuch as inside event loops or worker threads.\n\nIt causes a function to return `(func_return, None)`\nin the case of successful operation\nand `(None, exc_info)` in the case of an exception.\n\n`exc_info` is a 3-tuple of `(exc_type, exc_value, exc_traceback)`\nas returned by `sys.exc_info()`.\n\n## Function `safe_property(func)`\n\nSubstitute for @property which lets AttributeErrors escape as RuntimeErrors.\n\n## Function `transmute(exc_from, exc_to=None)`\n\nDecorator to transmute an inner exception to another exception type.\n\nThe motivating use case is properties in a class with a\n__getattr__ method; if some inner operation of the property\nfunction raises AttributeError then the property is bypassed\nin favour of __getattr__. Confusion ensues.\n\nIn principle this can be an issue with any exception raised\nfrom \"deeper\" in the call chain, which can be mistaken for a\n\"shallow\" exception raise by the function itself.\n\n## Function `unattributable(func)`\n\nDecorator to transmute AttributeError into a RuntimeError.\n\n## Function `unimplemented(func)`\n\nDecorator for stub methods that must be implemented by a stub class.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all", "keywords": "python2,python3", "license": "", "maintainer": "", "maintainer_email": "", "name": "cs.excutils", "package_url": "https://pypi.org/project/cs.excutils/", "platform": "", "project_url": "https://pypi.org/project/cs.excutils/", "project_urls": { "Homepage": "https://bitbucket.org/cameron_simpson/css/commits/all" }, "release_url": "https://pypi.org/project/cs.excutils/20190220/", "requires_dist": null, "requires_python": "", "summary": "Convenience facilities for managing exceptions.", "version": "20190220" }, "last_serial": 4844504, "releases": { "20150110": [ { "comment_text": "", "digests": { "md5": "3d2cfe3700c7f0af5a34b56fc7890800", "sha256": "f9938e39ba08ae55ce2d6851bb07a65d3b14a5d8e0e557d33458bf5a3299fb7d" }, "downloads": -1, "filename": "cs.excutils-20150110.tar.gz", "has_sig": false, "md5_digest": "3d2cfe3700c7f0af5a34b56fc7890800", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3293, "upload_time": "2015-01-18T05:55:20", "url": "https://files.pythonhosted.org/packages/2b/3e/dc49942704d2e38be528fa482611e5c80660f9400ea01e5ac81b90887192/cs.excutils-20150110.tar.gz" } ], "20150118": [ { "comment_text": "", "digests": { "md5": "7ad0db5c34df8052ba3c3b534756c116", "sha256": "1001db6293685b47b8ec9d813e05b7f99bdc773f27894399d8e94d9c9e264035" }, "downloads": -1, "filename": "cs.excutils-20150118.tar.gz", "has_sig": false, "md5_digest": "7ad0db5c34df8052ba3c3b534756c116", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3388, "upload_time": "2015-01-18T05:57:11", "url": "https://files.pythonhosted.org/packages/6d/a3/dadb4c01fa3b84a24cfed47c228008bec0511184acd92afbee57419f9186/cs.excutils-20150118.tar.gz" } ], "20160828": [ { "comment_text": "", "digests": { "md5": "f74046083889a3430a5954a08ec9cfa8", "sha256": "c4d5329ba300c4b2487565113cab480eb9d4e7145468af896347e7881880369f" }, "downloads": -1, "filename": "cs.excutils-20160828.tar.gz", "has_sig": false, "md5_digest": "f74046083889a3430a5954a08ec9cfa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3745, "upload_time": "2016-08-28T06:05:04", "url": "https://files.pythonhosted.org/packages/24/eb/e6678866c570d669c85d120b6779714d485db700d31f1f8839767f51f89c/cs.excutils-20160828.tar.gz" } ], "20170904": [ { "comment_text": "", "digests": { "md5": "f0a5550d44253880eb9ee0f84b098f3e", "sha256": "605660d398b1c4756f66d824b30b0ea8af71982d46790391fe81ba5cdfa506a1" }, "downloads": -1, "filename": "cs.excutils-20170904.tar.gz", "has_sig": false, "md5_digest": "f0a5550d44253880eb9ee0f84b098f3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3850, "upload_time": "2017-09-04T04:47:35", "url": "https://files.pythonhosted.org/packages/f4/bc/c92461b72230cb3b9338e59d79cd940e42457c7cee218c35d9b8467e7779/cs.excutils-20170904.tar.gz" } ], "20190101": [ { "comment_text": "", "digests": { "md5": "5384bb254b829af81f525b273788f8af", "sha256": "0637f739b6f95576abce60a59e2323a7d2537154b0c080116c46fffeedee2eec" }, "downloads": -1, "filename": "cs.excutils-20190101.tar.gz", "has_sig": false, "md5_digest": "5384bb254b829af81f525b273788f8af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4180, "upload_time": "2018-12-31T23:10:20", "url": "https://files.pythonhosted.org/packages/68/c3/a4b22eec85276e4ab7198c58a95cfe5d605d7f19521f29900b109831ab48/cs.excutils-20190101.tar.gz" } ], "20190220": [ { "comment_text": "", "digests": { "md5": "24db5d1a15879415bda0b20d3b813d3a", "sha256": "4fd5bf42818abeb2a02d9d12b4f89be83fce70da32cc0cfe57f32e944d239e58" }, "downloads": -1, "filename": "cs.excutils-20190220.tar.gz", "has_sig": false, "md5_digest": "24db5d1a15879415bda0b20d3b813d3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4432, "upload_time": "2019-02-20T09:14:09", "url": "https://files.pythonhosted.org/packages/ab/07/72467faff91de73c76f5d820b7e520bbd60a87d1e0f92a23d263e03cbc37/cs.excutils-20190220.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24db5d1a15879415bda0b20d3b813d3a", "sha256": "4fd5bf42818abeb2a02d9d12b4f89be83fce70da32cc0cfe57f32e944d239e58" }, "downloads": -1, "filename": "cs.excutils-20190220.tar.gz", "has_sig": false, "md5_digest": "24db5d1a15879415bda0b20d3b813d3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4432, "upload_time": "2019-02-20T09:14:09", "url": "https://files.pythonhosted.org/packages/ab/07/72467faff91de73c76f5d820b7e520bbd60a87d1e0f92a23d263e03cbc37/cs.excutils-20190220.tar.gz" } ] }