@onlineapps/infrastructure-tools 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/infrastructure-tools",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Infrastructure orchestration utilities for OA Drive infrastructure services (health tracking, queue initialization, service discovery)",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -209,12 +209,26 @@ function createBaseClientAdapter(baseClient, serviceName, getHealthData, config,
209
209
  status: data.status
210
210
  });
211
211
  } catch (error) {
212
- logger.error(`[InfrastructureHealth:${serviceName}] [PUBLISH] Failed to publish health check`, {
212
+ // Log detailed error information including cause
213
+ const errorDetails = {
213
214
  queueName,
214
- error: error.message,
215
+ error: error.message || error.toString(),
215
216
  stack: error.stack,
216
- code: error.code
217
- });
217
+ code: error.code,
218
+ name: error.name
219
+ };
220
+
221
+ // Include cause if available (PublishError, ConnectionError, etc.)
222
+ if (error.cause) {
223
+ errorDetails.cause = {
224
+ message: error.cause.message || error.cause.toString(),
225
+ name: error.cause.name,
226
+ code: error.cause.code,
227
+ stack: error.cause.stack
228
+ };
229
+ }
230
+
231
+ logger.error(`[InfrastructureHealth:${serviceName}] [PUBLISH] ✗ Failed to publish health check`, errorDetails);
218
232
  throw error;
219
233
  }
220
234
  };
@@ -85,8 +85,11 @@ async function initInfrastructureQueues(channel, options = {}) {
85
85
  for (const queueName of queuesToCreate) {
86
86
  try {
87
87
  // Verify it's an infrastructure queue
88
- if (!queueConfig.isInfrastructureQueue(queueName)) {
89
- logger.warn(`[QueueInit] Skipping ${queueName} - not an infrastructure queue`);
88
+ const isInfra = queueConfig.isInfrastructureQueue(queueName);
89
+ if (!isInfra) {
90
+ logger.warn(`[QueueInit] Skipping ${queueName} - not an infrastructure queue (isInfrastructureQueue returned: ${isInfra})`);
91
+ // Debug: log the actual function code to verify it's the right version
92
+ logger.warn(`[QueueInit] Debug: isInfrastructureQueue function: ${queueConfig.isInfrastructureQueue.toString().substring(0, 200)}...`);
90
93
  continue;
91
94
  }
92
95