Skip to content

Improve validation and error handling in KnowledgeSpace API wrapper#41

Merged
QuantumByte-01 merged 1 commit intoINCF:mainfrom
subh123321:improve-ks-api-validation
Mar 12, 2026
Merged

Improve validation and error handling in KnowledgeSpace API wrapper#41
QuantumByte-01 merged 1 commit intoINCF:mainfrom
subh123321:improve-ks-api-validation

Conversation

@subh123321
Copy link
Contributor

This PR improves robustness of the KnowledgeSpace API wrapper by adding:

  • Input validation for user queries and IDs
  • Consistent request timeouts
  • Shared HTTP session for better performance
  • Clearer error handling for network and timeout failures

These changes improve backend stability when running inside Docker
and make API failures easier to diagnose.

@QuantumByte-01
Copy link
Collaborator

Clean, well-scoped improvement — adds proper input validation, a typed exception hierarchy (ValueError, Timeout, RequestException), uses a requests.Session for connection pooling, and moves the timeout to a named constant. No unnecessary changes, good understanding of the codebase. Merging.

@QuantumByte-01 QuantumByte-01 merged commit da11451 into INCF:main Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants