Logging
Network Activity Monitoring
Monitor and debug network activities in your social.plus SDK integration with comprehensive logging capabilities.Best Practice: Enable network logging during development to troubleshoot issues, but disable it in production to avoid performance overhead.
observeNetworkActivities()
function provides real-time insights into all HTTP requests and responses within the SDK, enabling effective debugging and performance analysis.
Key Features
- Request/Response Logging: Monitor all API calls with detailed information
- Performance Metrics: Track request timing and response sizes
- Error Debugging: Identify network-related issues quickly
- Development Tool: Essential for troubleshooting SDK integration
Troubleshooting
Common Issues
High Memory Usage
High Memory Usage
Network logging stores request/response data in memory. Disable logging in production or implement log rotation for long-running applications.
Performance Impact
Performance Impact
Logging adds overhead to network operations. Use conditional compilation flags to disable in release builds.
Log Volume
Log Volume
social.plus apps can generate many API calls. Implement filtering to log only specific endpoints or error conditions.
Error Handling
Effective error handling is crucial for building reliable social applications. social.plus SDK provides structured error information to help you handle different scenarios gracefully.Error Types
social.plus errors are categorized into two main types:Server Errors
Issues on the social.plus backend (400xxx, 500xxx codes)
Client Errors
Issues in the SDK or client environment (800xxx codes)
Common Server Errors
Authentication Errors (400100-400199)
Authentication Errors (400100-400199)
Code | Error | Description |
---|---|---|
400100 | UnauthorizedError | User not authenticated or invalid token |
400101 | TokenExpired | Authentication token has expired |
Permission Errors (400300-400399)
Permission Errors (400300-400399)
Code | Error | Description |
---|---|---|
400301 | PermissionDenied | User lacks permission for the action |
400302 | UserIsMuted | Muted user attempting to send message |
400304 | UserIsBanned | Banned user accessing restricted content |
400312 | GlobalBanError | Globally banned user performing any action |
Content Moderation (400307-400320)
Content Moderation (400307-400320)
Code | Error | Description |
---|---|---|
400307 | MaxRepetitionExceed | Too many messages with blocked content |
400308 | BanWordFound | Message contains blocked words |
400309 | LinkNotAllowed | Message contains non-whitelisted links |
400314 | UnsafeContent | Content flagged by AI moderation |
Data & Business Logic (400000-400999)
Data & Business Logic (400000-400999)
Code | Error | Description |
---|---|---|
400000 | BadRequestError | Invalid request parameters |
400315 | DuplicateEntryError | Duplicate display name or identifier |
400400 | ItemNotFound | Requested resource not found |
400900 | Conflict | Conflicting data operation |
System Errors (500000+)
System Errors (500000+)
Code | Error | Description |
---|---|---|
500000 | BusinessError | Internal system error |
Client Errors
Code | Error | Description |
---|---|---|
800000 | Unknown | Uncategorized client-side error |
800110 | InvalidParameter | Invalid parameter data type |
800210 | ConnectionError | Network connectivity issues |
Error Handling Implementation
Basic Error Parsing
Global Ban Handling
A global ban error means that the user is banned from the system resulting in the inability to have a connection with the system. If the user already has a session, the session will be revoked, and will be unable to create a new session.Best Practices
Do’s ✅
- Provide specific error messages based on error codes
- Log errors for debugging and monitoring
- Implement retry logic for network errors
- Handle global bans with appropriate user communication
- Use error boundaries in React applications
- Show loading states during error recovery
Don’ts ❌
- Don’t ignore errors - always handle them appropriately
- Don’t show technical error codes to end users
- Don’t retry indefinitely - implement maximum retry limits
- Don’t expose sensitive information in error messages
Pro Tip: Use network logging to identify performance bottlenecks, monitor error rates, and validate that your app is making expected API calls during development.