Skip to content

Add error formatting to rate limit handler logging #1982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fileignoreconfig:
- filename: pnpm-lock.yaml
checksum: 63d408024e8d1f64b0f23a4db8107c1ee0f450f4b8233ba7831e50f596e39d24
checksum: 144fd75cbb336e8c93b3e58dc45ec4d3ea7c699f6dc9d9e5af1ae6a310720c0a
- filename: packages/contentstack-import/test/integration/auth-token-modules/environments.test.js
checksum: bc6f06b75d082aaf99e2f2f4b932b143765e2f14086967fb8973fe1b2ca6c03e
- filename: packages/contentstack-import/test/integration/environments.test.js
checksum: e71f033dad8944ffeafdf22d0514bda1d20c43e8fea0d62c96e774f3414beb31
- filename: package-lock.json
checksum: 8a1af78f7abed40e4894fbc1b82f3b5ffffea76550250c4e9c3d0dda12e59db7
checksum: 8699ac1d7b2d3af92b6a95cbb9898ad5bb4e7eb17527824cd6ecdd14e6cfde5a
- filename: packages/contentstack-auth/test/unit/tokens-validation.test.ts
checksum: 676052e30d31a771ce68302d89b050d176bbef50f3abc7e9cdd4384f0e274e10
- filename: packages/contentstack-import/test/integration/auth-token.test.js
Expand Down Expand Up @@ -51,4 +51,6 @@ fileignoreconfig:
checksum: 9c79540ab8522736f17c3ae1c9bfea07784b6ed0aa41f5617c90ba6812b91e72
- filename: packages/contentstack-import/test/integration/auth-token-modules/global-fields.test.js
checksum: db5b7aedcd89d783760eb988a2369243c34edc9c12e93a41b2b08fb0da02afdc
- filename: packages/contentstack-export/src/export/modules/assets.ts
checksum: c7f19e6c4a212329d981cebce9a9a8393923dd7c85feb762ddcdca678f7a9349
version: ''
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { cliux, configHandler } from '@contentstack/cli-utilities';
import { cliux, configHandler, formatError } from '@contentstack/cli-utilities';
import { limitNamesConfig, defaultRalteLimitConfig } from '../utils/common-utilities';
import { Limit } from '../interfaces';

let client: any;

Check warning on line 5 in packages/contentstack-config/src/utils/rate-limit-handler.ts

View workflow job for this annotation

GitHub Actions / run-tests

Unexpected any. Specify a different type

export class RateLimitHandler {
setClient(managementSDKClient) {
Expand Down Expand Up @@ -66,6 +66,7 @@
}
});
} catch (error) {
console.log('Something went wrong while setting rate limit for org:', formatError(error));
throw new Error(error);
}
}
Expand Down
14 changes: 7 additions & 7 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-variants": "~1.2.1",
"@oclif/core": "^4.3.0",
"@contentstack/cli-command": "~1.5.1",
"@contentstack/cli-variants": "~1.2.2",
"@oclif/core": "^4.3.3",
"@contentstack/cli-utilities": "~1.12.0",
"async": "^3.2.6",
"big-json": "^3.2.0",
Expand All @@ -21,9 +21,9 @@
"winston": "^3.17.0"
},
"devDependencies": {
"@contentstack/cli-auth": "~1.4.0",
"@contentstack/cli-config": "~1.12.0",
"@contentstack/cli-dev-dependencies": "~1.3.0",
"@contentstack/cli-auth": "~1.4.1",
"@contentstack/cli-config": "~1.12.1",
"@contentstack/cli-dev-dependencies": "~1.3.1",
"@oclif/plugin-help": "^6.2.28",
"@oclif/test": "^4.1.13",
"@types/big-json": "^3.2.5",
Expand All @@ -32,7 +32,7 @@
"dotenv": "^16.5.0",
"dotenv-expand": "^9.0.0",
"eslint": "^8.57.1",
"eslint-config-oclif": "^6.0.62",
"eslint-config-oclif": "^6.0.68",
"mocha": "10.8.2",
"nyc": "^15.1.0",
"oclif": "^4.17.46",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export/src/export/modules/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class ExportAssets extends BaseClass {
indexFileName: 'assets.json',
basePath: this.assetsRootPath,
chunkFileSize: this.assetConfig.chunkFileSize,
metaPickKeys: merge(['uid', 'url', 'filename'], this.assetConfig.assetsMetaKeys),
metaPickKeys: merge(['uid', 'url', 'filename', 'parent_uid'], this.assetConfig.assetsMetaKeys),
});
}
if (!isEmpty(items)) fs?.writeIntoFile(items, { mapKeyVal: true });
Expand Down Expand Up @@ -211,7 +211,7 @@ export default class ExportAssets extends BaseClass {
indexFileName: 'versioned-assets.json',
chunkFileSize: this.assetConfig.chunkFileSize,
basePath: pResolve(this.assetsRootPath, 'versions'),
metaPickKeys: merge(['uid', 'url', 'filename', '_version'], this.assetConfig.assetsMetaKeys),
metaPickKeys: merge(['uid', 'url', 'filename', '_version', 'parent_uid'], this.assetConfig.assetsMetaKeys),
});
}
if (!isEmpty(response))
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@contentstack/cli-cm-seed": "~1.11.2",
"@contentstack/cli-command": "~1.5.1",
"@contentstack/cli-config": "~1.13.0",
"@contentstack/cli-launch": "^1.9.1",
"@contentstack/cli-launch": "^1.9.2",
"@contentstack/cli-migration": "~1.7.3",
"@contentstack/cli-utilities": "~1.12.0",
"@contentstack/cli-variants": "~1.2.2",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading