diff --git a/apps/kubernetes-provider/src/index.ts b/apps/kubernetes-provider/src/index.ts index 5af16bd6b..fe6240efd 100644 --- a/apps/kubernetes-provider/src/index.ts +++ b/apps/kubernetes-provider/src/index.ts @@ -374,20 +374,18 @@ class KubernetesTaskOperations implements TaskOperations { } } - #throwUnlessNonNullableObject( - candidate: unknown - ): asserts candidate is NonNullable> { + #throwUnlessRecord(candidate: unknown): asserts candidate is Record { if (typeof candidate !== "object" || candidate === null) { throw candidate; } } #handleK8sError(err: unknown) { - this.#throwUnlessNonNullableObject(err); + this.#throwUnlessRecord(err); if ("body" in err && err.body) { logger.error(err.body); - this.#throwUnlessNonNullableObject(err.body); + this.#throwUnlessRecord(err.body); if (typeof err.body.message === "string") { throw new Error(err.body?.message);