Problem
Currently, when SQL queries fail on the server side (e.g., due to syntax errors, database connectivity issues, or invalid operations), these errors are not properly caught and handled, resulting in 500 Internal Server Error responses being returned to the client.
Background
This issue was identified during the investigation of PR #1136, which fixed invalid SQL CAST operations causing MySQL compatibility issues in the WebUI. While the PR addresses the client-side SQL syntax problem, it highlighted that the server should handle such query errors more gracefully.
Current Behavior
- SQL query errors cause unhandled exceptions on the server
- 500 Internal Server Error responses are returned to the client
- Limited debugging information available for troubleshooting
- Poor user experience when database issues occur
Expected Behavior
The server should:
- Catch and handle SQL query errors appropriately
- Return meaningful HTTP status codes and error messages to the client
- Log detailed error information for debugging purposes
- Provide graceful degradation when possible
- Prevent internal server errors from reaching the client unnecessarily
Impact
- Better user experience with more informative error messages
- Easier debugging and troubleshooting of database-related issues
- More robust error handling architecture
- Improved system reliability
References
Acceptance Criteria
Problem
Currently, when SQL queries fail on the server side (e.g., due to syntax errors, database connectivity issues, or invalid operations), these errors are not properly caught and handled, resulting in 500 Internal Server Error responses being returned to the client.
Background
This issue was identified during the investigation of PR #1136, which fixed invalid SQL CAST operations causing MySQL compatibility issues in the WebUI. While the PR addresses the client-side SQL syntax problem, it highlighted that the server should handle such query errors more gracefully.
Current Behavior
Expected Behavior
The server should:
Impact
References
BIGINTvalues asUNSIGNEDto fix MySQL-specific type errors in dashboard stats queries (fixes #1137). #1136 (MySQL compatibility fix)BIGINTvalues asUNSIGNEDto fix MySQL-specific type errors in dashboard stats queries (fixes #1137). #1136 (comment)Acceptance Criteria