Skip to content

Commit a570035

Browse files
chore: pass inner exception as a cause
1 parent 78c79d5 commit a570035

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ async function retryTestDynatraceConnection(
114114
if (retryCount >= maxRetries) {
115115
console.error(`Fatal: Maximum number of connection retries (${maxRetries}) exceeded. Exiting.`);
116116
throw new Error(
117-
`Failed to connect to Dynatrace environment ${dtEnvironment} after ${maxRetries} attempts. Most likely your configuration is incorrect.`,
117+
`Failed to connect to Dynatrace environment ${dtEnvironment} after ${maxRetries} attempts. Most likely your configuration is incorrect. Last error: ${error.message}`,
118+
{ cause: error },
118119
);
119120
}
120121
const delay = Math.pow(2, retryCount) * delayMs; // Exponential backoff

0 commit comments

Comments
 (0)