{"id":16853159,"url":"https://github.com/devxoul/flask-errorhandler","last_synced_at":"2025-04-11T07:08:56.574Z","repository":{"id":17010206,"uuid":"19773538","full_name":"devxoul/flask-errorhandler","owner":"devxoul","description":"Error handlers for Flask blueprints.","archived":false,"fork":false,"pushed_at":"2020-04-14T12:24:08.000Z","size":132,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-03T17:55:45.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devxoul.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-14T09:16:53.000Z","updated_at":"2020-07-03T03:50:17.000Z","dependencies_parsed_at":"2022-08-29T05:30:25.450Z","dependency_job_id":null,"html_url":"https://github.com/devxoul/flask-errorhandler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoul%2Fflask-errorhandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoul%2Fflask-errorhandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoul%2Fflask-errorhandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxoul%2Fflask-errorhandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devxoul","download_url":"https://codeload.github.com/devxoul/flask-errorhandler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239379345,"owners_count":19628685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T13:49:59.970Z","updated_at":"2025-02-19T00:31:24.409Z","avatar_url":"https://github.com/devxoul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flask-ErrorHandler\n==================\n\nFlask-ErrorHandler provides a generic error handler for blueprints.\n\nSample:\n\n.. code-block:: python\n\n    from flask import Flask, Blueprint\n    from flask.ext.errorhandler import ErrorHandler\n    import json\n\n    app = Flask(__name__)\n    api_blueprint = Blueprint('api', 'api')\n    web_blueprint = Blueprint('web', 'web')\n\n    errorhandler = ErrorHandler()\n    errorhandler.init_app(app)\n\n    @errorhandler.errorhandler(api_blueprint)\n    def handle_error(e):\n        data = {\n            'error': {\n                'code': e.code,\n                'message': e.description\n            }\n        }\n        response = Response(json.dumps(data),\n                            mimetype='application/json',\n                            status=e.code)\n        return response\n\n    @errorhandler.errorhandler(web_blueprint)\n    def handle_error(e):\n        body = '\u003ch1\u003e%d\u003c/h1\u003e\u003cp\u003e%s\u003c/p\u003e' % (e.code, e.description)\n        response = Response(body, mimetype='text/html', status=e.code)\n        return response\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxoul%2Fflask-errorhandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevxoul%2Fflask-errorhandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxoul%2Fflask-errorhandler/lists"}