Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit d4260d8

Browse files
committed
Echo out logging exception error
1 parent 971eee5 commit d4260d8

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tests/integration/helpers.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,19 @@ async function displayAllLogsForJob(jobName) {
5656
);
5757

5858
for (const container of pod.spec.containers) {
59-
const response = await k8sPodsApi.readNamespacedPodLog(
60-
pod.metadata.name,
61-
namespace,
62-
container.name
63-
);
64-
console.log(`Container ${container.name}:`);
65-
console.log(response.body);
59+
try {
60+
const response = await k8sPodsApi.readNamespacedPodLog(
61+
pod.metadata.name,
62+
namespace,
63+
container.name
64+
);
65+
console.log(`Container ${container.name}:`);
66+
console.log(response.body);
67+
} catch (exception) {
68+
console.error(
69+
`Failed to display logs of container ${container.name}: ${exception.body.message}`
70+
);
71+
}
6672
}
6773
}
6874
}

0 commit comments

Comments
 (0)