Skip to content

Commit

Permalink
chore(cli): improve error message when tree.json not found (#19887)
Browse files Browse the repository at this point in the history
Related to #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*
  • Loading branch information
Chriscbr committed Apr 12, 2022
1 parent 697fdbe commit aa834be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk/lib/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {};
}
}
Expand Down

0 comments on commit aa834be

Please sign in to comment.