From cd8ab0c170380511f415a689f578bcb05a408eeb Mon Sep 17 00:00:00 2001 From: Robin Y Bobbitt Date: Fri, 2 Aug 2024 12:29:45 -0400 Subject: [PATCH 1/2] additional logging when proxy block requests to lightspeed --- src/features/lightspeed/lightSpeedOAuthProvider.ts | 4 ++++ src/features/lightspeed/lightspeedUser.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/features/lightspeed/lightSpeedOAuthProvider.ts b/src/features/lightspeed/lightSpeedOAuthProvider.ts index ba4601bd3..daeea8bc2 100644 --- a/src/features/lightspeed/lightSpeedOAuthProvider.ts +++ b/src/features/lightspeed/lightSpeedOAuthProvider.ts @@ -400,6 +400,10 @@ export class LightSpeedAuthenticationProvider "[ansible-lightspeed-oauth] error message: ", error.message, ); + console.error( + "[ansible-lightspeed-oauth] error response data: ", + error.response?.data, + ); throw new Error("An unexpected error occurred"); } else { console.error("[ansible-lightspeed-oauth] unexpected error: ", error); diff --git a/src/features/lightspeed/lightspeedUser.ts b/src/features/lightspeed/lightspeedUser.ts index 028c48af4..73750157f 100644 --- a/src/features/lightspeed/lightspeedUser.ts +++ b/src/features/lightspeed/lightspeedUser.ts @@ -173,6 +173,10 @@ export class LightspeedUser { this._logger.error( `[ansible-lightspeed-user] error message: ${error.message}`, ); + console.error( + "[ansible-lightspeed-user] error response data: ", + error.response?.data, + ); throw new Error(error.message); } else { this._logger.error( From d76cca2e8258d93fd46c3c446ebcf93d48e44931 Mon Sep 17 00:00:00 2001 From: Robin Y Bobbitt Date: Fri, 2 Aug 2024 14:56:02 -0400 Subject: [PATCH 2/2] add istanbul ignore for error logging --- src/features/lightspeed/lightSpeedOAuthProvider.ts | 1 + src/features/lightspeed/lightspeedUser.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/features/lightspeed/lightSpeedOAuthProvider.ts b/src/features/lightspeed/lightSpeedOAuthProvider.ts index daeea8bc2..02dedcb5a 100644 --- a/src/features/lightspeed/lightSpeedOAuthProvider.ts +++ b/src/features/lightspeed/lightSpeedOAuthProvider.ts @@ -400,6 +400,7 @@ export class LightSpeedAuthenticationProvider "[ansible-lightspeed-oauth] error message: ", error.message, ); + /* istanbul ignore next */ console.error( "[ansible-lightspeed-oauth] error response data: ", error.response?.data, diff --git a/src/features/lightspeed/lightspeedUser.ts b/src/features/lightspeed/lightspeedUser.ts index 73750157f..8e2b962c2 100644 --- a/src/features/lightspeed/lightspeedUser.ts +++ b/src/features/lightspeed/lightspeedUser.ts @@ -173,6 +173,7 @@ export class LightspeedUser { this._logger.error( `[ansible-lightspeed-user] error message: ${error.message}`, ); + /* istanbul ignore next */ console.error( "[ansible-lightspeed-user] error response data: ", error.response?.data,