Skip to content

Commit

Permalink
bump local-dev-lib dep and use better error logging util
Browse files Browse the repository at this point in the history
  • Loading branch information
brandenrodgers committed Feb 13, 2024
1 parent 71ff8b6 commit 2a39c42
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 27 deletions.
9 changes: 4 additions & 5 deletions packages/cli/commands/secrets/addSecret.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
logApiErrorInstance,
ApiErrorContext,
} = require('../../lib/errorHandlers/apiErrors');
const { addSecret } = require('@hubspot/local-dev-lib/api/secrets');
Expand Down Expand Up @@ -41,15 +41,14 @@ exports.handler = async options => {
secretName,
})
);
} catch (e) {
} catch (err) {
logger.error(
i18n(`${i18nKey}.errors.add`, {
secretName,
})
);
await logServerlessFunctionApiErrorInstance(
accountId,
e,
logApiErrorInstance(
err,
new ApiErrorContext({
request: 'add secret',
accountId,
Expand Down
9 changes: 4 additions & 5 deletions packages/cli/commands/secrets/deleteSecret.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
logApiErrorInstance,
} = require('../../lib/errorHandlers/apiErrors');
const { deleteSecret } = require('@hubspot/local-dev-lib/api/secrets');

Expand Down Expand Up @@ -38,15 +38,14 @@ exports.handler = async options => {
secretName,
})
);
} catch (e) {
} catch (err) {
logger.error(
i18n(`${i18nKey}.errors.delete`, {
secretName,
})
);
await logServerlessFunctionApiErrorInstance(
accountId,
e,
logApiErrorInstance(
err,
new ApiErrorContext({
request: 'delete a secret',
accountId,
Expand Down
9 changes: 4 additions & 5 deletions packages/cli/commands/secrets/listSecrets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
logApiErrorInstance,
ApiErrorContext,
} = require('../../lib/errorHandlers/apiErrors');
const { fetchSecrets } = require('@hubspot/local-dev-lib/api/secrets');
Expand Down Expand Up @@ -36,11 +36,10 @@ exports.handler = async options => {
logger.group(groupLabel);
results.forEach(secret => logger.log(secret));
logger.groupEnd(groupLabel);
} catch (e) {
} catch (err) {
logger.error(i18n(`${i18nKey}.errors.list`));
await logServerlessFunctionApiErrorInstance(
accountId,
e,
logApiErrorInstance(
err,
new ApiErrorContext({
request: 'add secret',
accountId,
Expand Down
9 changes: 4 additions & 5 deletions packages/cli/commands/secrets/updateSecret.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
logApiErrorInstance,
} = require('../../lib/errorHandlers/apiErrors');
const { updateSecret } = require('@hubspot/local-dev-lib/api/secrets');

Expand Down Expand Up @@ -42,15 +42,14 @@ exports.handler = async options => {
})
);
logger.log(i18n(`${i18nKey}.success.updateExplanation`));
} catch (e) {
} catch (err) {
logger.error(
i18n(`${i18nKey}.errors.update`, {
secretName,
})
);
await logServerlessFunctionApiErrorInstance(
accountId,
e,
logApiErrorInstance(
err,
new ApiErrorContext({
request: 'update secret',
accountId,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@hubspot/cli-lib": "^9.0.0",
"@hubspot/local-dev-lib": "^0.3.1",
"@hubspot/local-dev-lib": "^0.3.3",
"@hubspot/serverless-dev-runtime": "5.1.3",
"@hubspot/ui-extensions-dev-server": "0.8.9",
"archiver": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-dev-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "Apache-2.0",
"dependencies": {
"@hubspot/cli-lib": "^9.0.0",
"@hubspot/local-dev-lib": "^0.3.1",
"@hubspot/local-dev-lib": "^0.3.3",
"body-parser": "^1.19.0",
"chalk": "^4.1.0",
"chokidar": "^3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cms-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@hubspot/cli-lib": "^9.0.0",
"@hubspot/local-dev-lib": "^0.3.1"
"@hubspot/local-dev-lib": "^0.3.3"
},
"gitHead": "0659fd19cabc3645af431b177c11d0c1b089e0f8"
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@
table "^6.6.0"
unixify "1.0.0"

"@hubspot/local-dev-lib@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@hubspot/local-dev-lib/-/local-dev-lib-0.3.1.tgz#2137d3d41be41c50193346d15b8f6a8a039adf1c"
integrity sha512-w3Wjiadw0sJw2akRYbU4PfDK9eXDmm9iEMPNgMN7NH43U68+l2BgDK+KFk5z9bOftHZg1IdF9JuQmSo45q4Ddg==
"@hubspot/local-dev-lib@^0.3.3":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@hubspot/local-dev-lib/-/local-dev-lib-0.3.3.tgz#fe491d047c44926f1e1068dff17cc41d42830630"
integrity sha512-G9VSAtHvtE6WglJrSOIh9M8zUUYmVge+tq5Wt6FvZWdH2XMGQYO5GuQOp6X/eoOhgAyWNgcZPOMsJNSmrLNLvw==
dependencies:
address "^2.0.1"
axios "^1.3.5"
Expand Down

0 comments on commit 2a39c42

Please sign in to comment.