Fix type-checker error: replace JSONEncodeError with proper exception types

- Use json.JSONDecodeError, TypeError, ValueError instead of non-existent JSONEncodeError
- Addresses mypy type-checker failure in CI

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-01 07:03:26 +00:00
parent c1eb48bd6e
commit d6a79703d3

View File

@@ -108,7 +108,7 @@ class SQLiteFlowPersistence(FlowPersistence):
json.dumps(state_dict, cls=CrewJSONEncoder),
),
)
except json.JSONEncodeError as e:
except (json.JSONDecodeError, TypeError, ValueError) as e:
raise RuntimeError(f"Failed to serialize flow state: {str(e)}") from e
def load_state(self, flow_uuid: str) -> Optional[Dict[str, Any]]: