From 95dfeda96e9ab78b4e37fb658114e325552ce2a1 Mon Sep 17 00:00:00 2001 From: Thomas Bonnin <233326+TBonnin@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:22:20 -0500 Subject: [PATCH] fix(fleet): render error cause is swallowed by the logger (#3303) --- packages/fleet/lib/supervisor/supervisor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fleet/lib/supervisor/supervisor.ts b/packages/fleet/lib/supervisor/supervisor.ts index ef35d1f39aa..10c84852931 100644 --- a/packages/fleet/lib/supervisor/supervisor.ts +++ b/packages/fleet/lib/supervisor/supervisor.ts @@ -5,7 +5,7 @@ import { logger } from '../utils/logger.js'; import * as nodes from '../models/nodes.js'; import * as deployments from '../models/deployments.js'; import * as nodeConfigOverrides from '../models/node_config_overrides.js'; -import { Err, Ok, retryWithBackoff } from '@nangohq/utils'; +import { Err, errorToObject, Ok, retryWithBackoff } from '@nangohq/utils'; import type { Result } from '@nangohq/utils'; import { FleetError } from '../utils/errors.js'; import type { Node, NodeConfigOverride } from '../types.js'; @@ -290,7 +290,7 @@ export class Supervisor { const result = await this.execute(operation); if (result.isErr()) { operationSpan?.setTag('error', result.error); - logger.error('Failed to execute operation:', result.error, result.error.cause); + logger.error('Failed to execute operation:', result.error, errorToObject(result.error.cause)); } } );