global-handler 1.0.2__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {global_handler-1.0.2 → global_handler-1.0.3}/PKG-INFO +1 -1
- {global_handler-1.0.2 → global_handler-1.0.3}/pyproject.toml +4 -2
- global_handler-1.0.3/src/global_handler/config.py +1 -0
- global_handler-1.0.3/src/global_handler/controllers/base_controller.py +12 -0
- {global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/decorators/error_handler.py +2 -2
- {global_handler-1.0.2 → global_handler-1.0.3}/LICENSE +0 -0
- {global_handler-1.0.2 → global_handler-1.0.3}/README.md +0 -0
- {global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/decorators/request_decorators.py +0 -0
- {global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/exceptions/http_exceptions.py +0 -0
- {global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/middlewares/metrics_middleware.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: global-handler
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Global Handler es una librería Python diseñada para facilitar el manejo de errores, validaciones de requests y métricas en aplicaciones web
|
|
5
5
|
Author: Damian Gonzalez
|
|
6
6
|
Author-email: damian27goa@gmail.com
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "global-handler"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.3"
|
|
4
4
|
description = "Global Handler es una librería Python diseñada para facilitar el manejo de errores, validaciones de requests y métricas en aplicaciones web"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Damian Gonzalez", email = "damian27goa@gmail.com"}
|
|
7
7
|
]
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
packages = [
|
|
10
|
-
{ include = "global_handler", from = "src" }
|
|
10
|
+
{ include = "global_handler", from = "src" },
|
|
11
|
+
{ include = "global_handler/controllers", from = "src" },
|
|
12
|
+
{ include = "global_handler/config.py", from = "src" }
|
|
11
13
|
]
|
|
12
14
|
|
|
13
15
|
requires-python = ">=3.13"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DEBUG = False
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from flask import jsonify
|
|
2
|
+
|
|
3
|
+
class BaseController:
|
|
4
|
+
def error(self, message, details=None, status_code=500, error_code='UNKNOWN_ERROR'):
|
|
5
|
+
response = {
|
|
6
|
+
"error": {
|
|
7
|
+
"message": message,
|
|
8
|
+
"code": error_code,
|
|
9
|
+
"details": details
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return jsonify(response), status_code
|
{global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/decorators/error_handler.py
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
from
|
|
2
|
+
from ..controllers.base_controller import BaseController
|
|
3
3
|
from ..exceptions.http_exceptions import HttpError
|
|
4
4
|
from logger_tracker import logg_warning, _request_uuid, logg_debug, logg_error
|
|
5
|
-
from
|
|
5
|
+
from ..config import DEBUG
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def register_error_handlers(app):
|
|
File without changes
|
|
File without changes
|
{global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/decorators/request_decorators.py
RENAMED
|
File without changes
|
{global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/exceptions/http_exceptions.py
RENAMED
|
File without changes
|
{global_handler-1.0.2 → global_handler-1.0.3}/src/global_handler/middlewares/metrics_middleware.py
RENAMED
|
File without changes
|