@hubspot/cli 7.2.1 → 7.2.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lang/en.lyaml +3 -1
- package/lib/errorHandlers/index.js +17 -0
- package/lib/projects/buildAndDeploy.js +13 -11
- package/package.json +3 -3
package/lang/en.lyaml
CHANGED
|
@@ -1145,7 +1145,7 @@ en:
|
|
|
1145
1145
|
componentCount: "Found {{ numComponents }} components in this project"
|
|
1146
1146
|
successStatusText: "DONE"
|
|
1147
1147
|
failedStatusText: "FAILED"
|
|
1148
|
-
errorFetchingTaskStatus: "
|
|
1148
|
+
errorFetchingTaskStatus: "An error occurred while fetching the status of the current {{ taskType }}. For more information, view this project in HubSpot by running {{ openCommand }}."
|
|
1149
1149
|
pollBuildAutodeployStatusError: "Error fetching autodeploy status for build #{{ buildId }}"
|
|
1150
1150
|
pollProjectBuildAndDeploy:
|
|
1151
1151
|
buildSucceededAutomaticallyDeploying: "Build #{{ buildId }} succeeded. {{#bold}}Automatically deploying{{/bold}} to {{ accountIdentifier }}\n"
|
|
@@ -1514,6 +1514,8 @@ en:
|
|
|
1514
1514
|
errorContext: "Context: {{ context }}"
|
|
1515
1515
|
errorCause: "Cause: {{ cause }}"
|
|
1516
1516
|
unknownErrorOccurred: "An unknown error has occurred."
|
|
1517
|
+
configTimeoutErrorOccurred: "This error occurred because a request exceeded the default HTTP timeout of {{ timeout }}ms. To increase the default HTTP timeout, run {{ configSetCommand }}."
|
|
1518
|
+
genericTimeoutErrorOccurred: "This error occurred because an HTTP request timed out. Re-running the command may resolve this issue."
|
|
1517
1519
|
suppressErrors:
|
|
1518
1520
|
platformVersionErrors:
|
|
1519
1521
|
header: "Platform version update required"
|
|
@@ -8,9 +8,11 @@ exports.logError = logError;
|
|
|
8
8
|
exports.debugError = debugError;
|
|
9
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
10
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
11
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
11
12
|
const suppressError_1 = require("./suppressError");
|
|
12
13
|
const lang_1 = require("../lang");
|
|
13
14
|
const util_1 = __importDefault(require("util"));
|
|
15
|
+
const ui_1 = require("../ui");
|
|
14
16
|
const i18nKey = 'lib.errorHandlers.index';
|
|
15
17
|
function logError(error, context) {
|
|
16
18
|
debugError(error, context);
|
|
@@ -41,6 +43,21 @@ function logError(error, context) {
|
|
|
41
43
|
// Unknown errors
|
|
42
44
|
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.unknownErrorOccurred`));
|
|
43
45
|
}
|
|
46
|
+
if ((0, index_1.isHubSpotHttpError)(error) && error.code === 'ETIMEDOUT') {
|
|
47
|
+
const config = (0, config_1.getConfig)();
|
|
48
|
+
const defaultTimeout = config?.httpTimeout;
|
|
49
|
+
// Timeout was caused by the default timeout
|
|
50
|
+
if (error.timeout && defaultTimeout === error.timeout) {
|
|
51
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.configTimeoutErrorOccurred`, {
|
|
52
|
+
timeout: error.timeout,
|
|
53
|
+
configSetCommand: (0, ui_1.uiCommandReference)('hs config set'),
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
// Timeout was caused by a custom timeout set by the CLI or LDL
|
|
57
|
+
else {
|
|
58
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.genericTimeoutErrorOccurred`));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
44
61
|
}
|
|
45
62
|
function debugError(error, context) {
|
|
46
63
|
if ((0, index_1.isHubSpotHttpError)(error)) {
|
|
@@ -16,6 +16,7 @@ const lang_1 = require("../lang");
|
|
|
16
16
|
const errorHandlers_1 = require("../errorHandlers");
|
|
17
17
|
const ui_1 = require("../ui");
|
|
18
18
|
const urls_1 = require("./urls");
|
|
19
|
+
const exitCodes_1 = require("../enums/exitCodes");
|
|
19
20
|
const i18nKey = 'lib.projectBuildAndDeploy';
|
|
20
21
|
const SPINNER_STATUS = {
|
|
21
22
|
SPINNING: 'spinning',
|
|
@@ -48,6 +49,15 @@ function getSubtaskType(task) {
|
|
|
48
49
|
}
|
|
49
50
|
return task.deployType;
|
|
50
51
|
}
|
|
52
|
+
function handleTaskStatusError(statusText) {
|
|
53
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.makePollTaskStatusFunc.errorFetchingTaskStatus`, {
|
|
54
|
+
taskType: statusText.TYPE_KEY === constants_1.PROJECT_BUILD_TEXT.TYPE_KEY
|
|
55
|
+
? 'build'
|
|
56
|
+
: 'deploy',
|
|
57
|
+
openCommand: (0, ui_1.uiCommandReference)('hs project open'),
|
|
58
|
+
}));
|
|
59
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
60
|
+
}
|
|
51
61
|
function makePollTaskStatusFunc({ statusFn, structureFn, statusText, statusStrings, linkToHubSpot, }) {
|
|
52
62
|
return async function (accountId, taskName, taskId, deployedBuildId = null, silenceLogs = false) {
|
|
53
63
|
const displayId = deployedBuildId || taskId;
|
|
@@ -111,7 +121,7 @@ function makePollTaskStatusFunc({ statusFn, structureFn, statusText, statusStrin
|
|
|
111
121
|
task.subtasks.forEach((subtask, i) => addTaskSpinner(subtask, 4, i === task.subtasks.length - 1));
|
|
112
122
|
});
|
|
113
123
|
}
|
|
114
|
-
return new Promise(
|
|
124
|
+
return new Promise(resolve => {
|
|
115
125
|
const pollInterval = setInterval(async () => {
|
|
116
126
|
let taskStatus;
|
|
117
127
|
try {
|
|
@@ -124,19 +134,11 @@ function makePollTaskStatusFunc({ statusFn, structureFn, statusText, statusStrin
|
|
|
124
134
|
accountId,
|
|
125
135
|
projectName: taskName,
|
|
126
136
|
}));
|
|
127
|
-
|
|
128
|
-
taskType: statusText.TYPE_KEY === constants_1.PROJECT_BUILD_TEXT.TYPE_KEY
|
|
129
|
-
? 'build'
|
|
130
|
-
: 'deploy',
|
|
131
|
-
})));
|
|
137
|
+
handleTaskStatusError(statusText);
|
|
132
138
|
}
|
|
133
139
|
const subtasks = getSubtasks(taskStatus);
|
|
134
140
|
if (!taskStatus || !taskStatus.status || !subtasks) {
|
|
135
|
-
|
|
136
|
-
taskType: statusText.TYPE_KEY === constants_1.PROJECT_BUILD_TEXT.TYPE_KEY
|
|
137
|
-
? 'build'
|
|
138
|
-
: 'deploy',
|
|
139
|
-
})));
|
|
141
|
+
handleTaskStatusError(statusText);
|
|
140
142
|
}
|
|
141
143
|
const { status } = taskStatus;
|
|
142
144
|
if (SpinniesManager_1.default.hasActiveSpinners()) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2-beta.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.1.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.4.1",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.1.4",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.2",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.8.50",
|