We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1478cd commit ca50504Copy full SHA for ca50504
1 file changed
fishjam/api/_client.py
@@ -34,10 +34,16 @@ def _handle_deprecation_header(self, headers):
34
deprecation_warning = headers.get("x-fishjam-api-deprecated")
35
if deprecation_warning and not self.warnings_shown:
36
self.warnings_shown = True
37
- deprecation_warning = json.loads(deprecation_warning)
+ try:
38
+ deprecation_data = json.loads(deprecation_warning)
39
+ except (json.JSONDecodeError, TypeError, ValueError):
40
+ return
41
- status = deprecation_warning["status"]
- msg = deprecation_warning["message"]
42
+ status = deprecation_data["status"]
43
+ msg = deprecation_data["message"]
44
+
45
+ if not status or not msg:
46
47
48
match status:
49
case "unsupported":
0 commit comments