devinspector 2.0.2__tar.gz → 2.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devinspector
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: SDK Python de monitoramento e auditoria em tempo real | DevInspector
5
5
  Author-email: DevInspector <suporte@devinspector.com.br>
6
6
  License: MIT
@@ -200,6 +200,11 @@ class AuditCore:
200
200
  try:
201
201
  with urllib.request.urlopen(req, timeout=5):
202
202
  pass
203
+ except urllib.error.HTTPError as e:
204
+ # Mostra o erro detalhado que o painel devolveu
205
+ error_body = e.read().decode('utf-8', errors='ignore')
206
+ print(f"[DevInspector] HTTP {e.code} do painel: {e.reason} - Resposta: {error_body}")
207
+ print(f"[DevInspector] Payload enviado que gerou o erro: {payload}")
203
208
  except Exception as err:
204
209
  print(f"[DevInspector] Falha ao enviar requisição para o painel: {err}")
205
210
 
@@ -14,11 +14,16 @@ 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
+ if hasattr(exc, "status_code"):
19
+ status_code = exc.status_code
20
+
17
21
  audit.capture_error(
18
22
  exc,
19
23
  metadata={
20
24
  "path": request.url.path,
21
25
  "method": request.method,
26
+ "statusCode": status_code,
22
27
  },
23
28
  )
24
29
  raise exc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devinspector
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: SDK Python de monitoramento e auditoria em tempo real | DevInspector
5
5
  Author-email: DevInspector <suporte@devinspector.com.br>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devinspector"
7
- version = "2.0.2"
7
+ version = "2.0.4"
8
8
  description = "SDK Python de monitoramento e auditoria em tempo real | DevInspector"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes