Skip to content

Commit 27da931

Browse files
CopilotAnmol1696
andcommitted
Use consistent instanceof Error type checking for stack traces
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
1 parent 123cba1 commit 27da931

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

jobs/job-scheduler/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export default class Scheduler {
193193
) => {
194194
if (err) {
195195
log.error('Error connecting with notify listener', err);
196-
if (err.stack) {
196+
if (err instanceof Error && err.stack) {
197197
log.debug(err.stack);
198198
}
199199
// Try again in 5 seconds

jobs/knative-job-worker/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export default class Worker {
177177
) => {
178178
if (err) {
179179
log.error('Error connecting with notify listener', err);
180-
if (err.stack) {
180+
if (err instanceof Error && err.stack) {
181181
log.debug(err.stack);
182182
}
183183
// Try again in 5 seconds

0 commit comments

Comments
 (0)