From aa834be09aaf87dded7736e85de8cd1b37250ee1 Mon Sep 17 00:00:00 2001 From: Christopher Rybicki Date: Tue, 12 Apr 2022 16:58:51 -0700 Subject: [PATCH] chore(cli): improve error message when tree.json not found (#19887) Related to https://github.com/aws/aws-cdk/issues/19234. This improves the log wording so it's more clear this is not a "hard stop" error, and switch the log level to "trace" so it won't be shown in as many ordinary logs as a false positive error. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/lib/notices.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/notices.ts b/packages/aws-cdk/lib/notices.ts index fd92f4bf853c0..b0d40990ca1f8 100644 --- a/packages/aws-cdk/lib/notices.ts +++ b/packages/aws-cdk/lib/notices.ts @@ -2,7 +2,7 @@ import * as https from 'https'; import * as path from 'path'; import * as fs from 'fs-extra'; import * as semver from 'semver'; -import { debug, print } from './logging'; +import { debug, print, trace } from './logging'; import { flatMap } from './util'; import { cdkCacheDir } from './util/directories'; import { versionNumber } from './version'; @@ -323,7 +323,7 @@ function loadTree(outdir: string) { try { return fs.readJSONSync(path.join(outdir, 'tree.json')); } catch (e) { - debug(`Failed to get tree.json file: ${e}`); + trace(`Failed to get tree.json file: ${e}. Proceeding with empty tree.`); return {}; } }