{ "info": { "author": "Alberto Galera Jimenez", "author_email": "galerajimenez@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Bottle Errors Rest\n==================\n\nbottle\\_errorsrest plugin for bottle\n\nAll errors are now returned bottle json format.\n\nIf HTTPError receives a string becomes {'message': string}\n\ninstallation\n------------\n\nVia pip: ``pip install bottle_errorsrest``\n\nOr clone: ``git clone https://github.com/agalera/bottle_errorsrest.git``\n\nexample server:\n---------------\n\n.. code:: python\n\n from bottle import get, install, run, HTTPError\n from bottle_errorsrest import ErrorsRestPlugin\n\n\n @get(\"/\")\n def example():\n # {'message': 'oh no!'}\n raise HTTPError(500, \"oh no!\")\n\n @get(\"/2\")\n def example2():\n # {'other_Example': 'oh no!'}\n raise HTTPError(500, {'other_Example': 'oh no!'})\n\n\n install(ErrorsRestPlugin())\n\n run(host=\"0.0.0.0\", port=\"9988\")\n\nTest:\n-----\n\n.. code:: bash\n\n curl http://localhost:9988/ --head; curl http://localhost:9988/\n HTTP/1.0 500 Internal Server Error\n Date: Tue, 27 Sep 2016 11:16:41 GMT\n Server: WSGIServer/0.2 CPython/3.4.3\n Content-Type: application/json\n Content-Length: 20\n\n {\"message\": \"oh no!\"}\n\n curl http://localhost:9988/2 --head; curl http://localhost:9988/2\n HTTP/1.0 500 Internal Server Error\n Date: Tue, 27 Sep 2016 11:16:41 GMT\n Server: WSGIServer/0.2 CPython/3.4.3\n Content-Type: application/json\n Content-Length: 20\n\n {\"other_Example\": \"oh no!\"}\n\n curl http://localhost:9988/not_found --head; curl http://localhost:9988/not_found\n HTTP/1.0 404 Not Found\n Date: Tue, 27 Sep 2016 11:11:39 GMT\n Server: WSGIServer/0.2 CPython/3.4.3\n Content-Length: 38\n Content-Type: application/json\n\n {\"message\": \"Not found: '/not_found'\"}\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/agalera/bottle-errorsrest", "keywords": "bottle_errorsrest", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "bottle_errorsrest", "package_url": "https://pypi.org/project/bottle_errorsrest/", "platform": "", "project_url": "https://pypi.org/project/bottle_errorsrest/", "project_urls": { "Homepage": "https://github.com/agalera/bottle-errorsrest" }, "release_url": "https://pypi.org/project/bottle_errorsrest/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "ErrorsRest plugin for bottle", "version": "0.0.3" }, "last_serial": 3781429, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "13ad56151ac1a368d84a24cab71f7346", "sha256": "6dbc6d1b8022f59b5cce8c97eb12da9cbff37b0432d3d347f6b881dcc61d061e" }, "downloads": -1, "filename": "bottle_errorsrest-0.0.1.tar.gz", "has_sig": false, "md5_digest": "13ad56151ac1a368d84a24cab71f7346", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2457, "upload_time": "2016-09-27T11:24:03", "url": "https://files.pythonhosted.org/packages/20/4c/6e4a549f8e03cb7f7073882d91af86f310004b672e3791e5605f29f1078b/bottle_errorsrest-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "08458ce20274fb7147d2b2da40b43e3a", "sha256": "98a06ac885bda0e8bfcc6e9260c8fbd5a25e25a4805148c5880fa17e715386f5" }, "downloads": -1, "filename": "bottle_errorsrest-0.0.2.tar.gz", "has_sig": false, "md5_digest": "08458ce20274fb7147d2b2da40b43e3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2520, "upload_time": "2016-09-27T11:28:46", "url": "https://files.pythonhosted.org/packages/54/ba/7298bac24041b35b76ee3a4b49d1243aafbd700db889c559fe3e18cf81a0/bottle_errorsrest-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "af9fcf83ac0c9b2d189c0a518cc27cfb", "sha256": "9e981b8c3190880a060f842ab94e520bb25bda10cc9a3a8b41a6a65294cb3df4" }, "downloads": -1, "filename": "bottle_errorsrest-0.0.3.tar.gz", "has_sig": false, "md5_digest": "af9fcf83ac0c9b2d189c0a518cc27cfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2429, "upload_time": "2018-04-19T17:04:42", "url": "https://files.pythonhosted.org/packages/a1/e0/d267b777195d8c6e5b4b772476fd57cf43af5cc7befd80493b4210eed98e/bottle_errorsrest-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af9fcf83ac0c9b2d189c0a518cc27cfb", "sha256": "9e981b8c3190880a060f842ab94e520bb25bda10cc9a3a8b41a6a65294cb3df4" }, "downloads": -1, "filename": "bottle_errorsrest-0.0.3.tar.gz", "has_sig": false, "md5_digest": "af9fcf83ac0c9b2d189c0a518cc27cfb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2429, "upload_time": "2018-04-19T17:04:42", "url": "https://files.pythonhosted.org/packages/a1/e0/d267b777195d8c6e5b4b772476fd57cf43af5cc7befd80493b4210eed98e/bottle_errorsrest-0.0.3.tar.gz" } ] }