Skip to content

Commit

Permalink
[ws-manager-api] Log ws-manager call error
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Nov 19, 2021
1 parent a53a87b commit 87e44ed
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TraceContext } from '@gitpod/gitpod-protocol/lib/util/tracing';
import * as opentracing from 'opentracing';
import * as grpc from "@grpc/grpc-js";
import { Disposable } from "@gitpod/gitpod-protocol";
import { log } from '@gitpod/gitpod-protocol/lib/util/logging';

export function withTracing(ctx: TraceContext) {
const metadata = new grpc.Metadata();
Expand Down Expand Up @@ -46,7 +47,7 @@ async function linearBackoffRetry<Res>(run: (attempt: number) => Promise<Res>, a
throw err;
}

console.warn(`ws-manager unavailable - retrying in ${delayMS}ms`);
log.warn(`ws-manager unavailable - retrying in ${delayMS}ms`, err);
await new Promise((retry, _) => setTimeout(retry, delayMS));
}

Expand All @@ -55,7 +56,7 @@ async function linearBackoffRetry<Res>(run: (attempt: number) => Promise<Res>, a
}
}

console.error(`ws-manager unavailable - no more attempts left`);
log.error(`ws-manager unavailable - no more attempts left`);
throw error;
}

Expand Down

0 comments on commit 87e44ed

Please sign in to comment.