Skip to content

Commit f0543b7

Browse files
committed
debug: logging databricks error
1 parent 94e9422 commit f0543b7

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.changeset/light-states-learn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ansible-database-mcp": patch
3+
---
4+
5+
logging databricks error

src/services/db-connection/adapters/databricks-adapter.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,36 @@ export class DatabricksAdapter extends EventEmitter {
278278
} catch (error: any) {
279279
lastError = error;
280280

281+
// Debug logging - full error inspection
282+
console.log('[Databricks] Error caught in raw():');
283+
console.log('Error type:', error.constructor.name);
284+
console.log('Error properties:', Object.keys(error));
285+
console.log('Full error object:', JSON.stringify(error, null, 2));
286+
287+
// Check all possible error properties
288+
const errorInfo = {
289+
message: error.message,
290+
statusCode: error.statusCode,
291+
status: error.status,
292+
code: error.code,
293+
errno: error.errno,
294+
syscall: error.syscall,
295+
details: error.details,
296+
response: error.response,
297+
request: error.request,
298+
config: error.config,
299+
stack: error.stack,
300+
isConnectionError: this.isConnectionError(error),
301+
retryCount: retryCount
302+
};
303+
304+
// Log non-undefined properties
305+
const definedProps = Object.entries(errorInfo)
306+
.filter(([_, value]) => value !== undefined)
307+
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
308+
309+
console.log('Defined error properties:', definedProps);
310+
281311
if (this.isConnectionError(error) && retryCount < this.MAX_CONNECTION_RETRIES) {
282312
console.log(`[Databricks] Connection error detected, attempting reconnection (${retryCount + 1}/${this.MAX_CONNECTION_RETRIES})`);
283313

0 commit comments

Comments
 (0)