File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
src/services/db-connection/adapters Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " ansible-database-mcp " : patch
3+ ---
4+
5+ THTTPException error handling
Original file line number Diff line number Diff line change @@ -122,17 +122,33 @@ export class DatabricksAdapter extends EventEmitter {
122122
123123 /**
124124 * Check if error is a connection-related error
125+ *
126+ * THTTPException is thrown by Databricks SQL client when HTTP transport encounters errors.
127+ * Error structure:
128+ * - name: 'THTTPException'
129+ * - statusCode: HTTP status code (e.g., 400)
130+ * - type: Thrift TApplicationException type (7 = PROTOCOL_ERROR)
131+ * - response: Node.js Response object with status details
132+ *
133+ * Common causes for statusCode 400 with type 7:
134+ * - Session expired on server side (default 15 min idle timeout)
135+ * - Client connection in stale state after long idle period
136+ * - Protocol mismatch between client and server
137+ *
138+ * Note: The Databricks SQL Node.js documentation does not provide specific error type
139+ * definitions. This error handling is based on empirical observation and Thrift protocol
140+ * specifications.
125141 */
126142 private isConnectionError ( error : any ) : boolean {
127143 if ( ! error ) return false ;
128144
129- const errorMessage = error . message || '' ;
145+ const errorName = error . name || '' ;
130146 const statusCode = error . statusCode ;
131147
132148 // Only check for explicit indicators
133149 return (
134150 statusCode === 400 &&
135- errorMessage . includes ( 'THTTPException' )
151+ errorName === 'THTTPException'
136152 ) ;
137153 }
138154
You can’t perform that action at this time.
0 commit comments