devinspector 2.0.4__tar.gz → 2.0.6__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.
- {devinspector-2.0.4 → devinspector-2.0.6}/PKG-INFO +1 -1
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector/core.py +1 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector/fastapi.py +0 -1
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector/flask.py +6 -2
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector.egg-info/PKG-INFO +1 -1
- {devinspector-2.0.4 → devinspector-2.0.6}/pyproject.toml +1 -1
- {devinspector-2.0.4 → devinspector-2.0.6}/README.md +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector/__init__.py +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector.egg-info/SOURCES.txt +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector.egg-info/dependency_links.txt +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector.egg-info/requires.txt +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/devinspector.egg-info/top_level.txt +0 -0
- {devinspector-2.0.4 → devinspector-2.0.6}/setup.cfg +0 -0
|
@@ -14,7 +14,6 @@ class DevInspectorMiddleware(BaseHTTPMiddleware):
|
|
|
14
14
|
status_code = response.status_code
|
|
15
15
|
return response
|
|
16
16
|
except Exception as exc:
|
|
17
|
-
# Se for uma HTTPException do Starlette/FastAPI, extraímos o status code dela
|
|
18
17
|
if hasattr(exc, "status_code"):
|
|
19
18
|
status_code = exc.status_code
|
|
20
19
|
|
|
@@ -22,16 +22,20 @@ class DevInspectorFlask:
|
|
|
22
22
|
|
|
23
23
|
def _teardown_request(self, exception=None):
|
|
24
24
|
if exception:
|
|
25
|
+
status_code = 500
|
|
26
|
+
if hasattr(exception, "code"):
|
|
27
|
+
status_code = exception.code
|
|
28
|
+
|
|
25
29
|
audit.capture_error(
|
|
26
30
|
exception,
|
|
27
31
|
metadata={
|
|
28
32
|
"path": request.path,
|
|
29
33
|
"method": request.method,
|
|
34
|
+
"statusCode": status_code,
|
|
30
35
|
},
|
|
31
36
|
)
|
|
32
|
-
# Garante que métrica de erro (500) seja registrada caso falhe antes do after_request
|
|
33
37
|
if not getattr(g, "_devinspector_metric_recorded", False):
|
|
34
|
-
self._record_metric(
|
|
38
|
+
self._record_metric(status_code)
|
|
35
39
|
|
|
36
40
|
def _record_metric(self, status_code: int):
|
|
37
41
|
start_time = getattr(g, "_devinspector_start_time", None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|