Skip to content

Commit 072c74d

Browse files
committed
Add generic timeout error
1 parent c4d66c6 commit 072c74d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lang/en.lyaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,8 @@ en:
15141514
errorContext: "Context: {{ context }}"
15151515
errorCause: "Cause: {{ cause }}"
15161516
unknownErrorOccurred: "An unknown error has occurred."
1517-
timeoutErrorOccurred: "This error occurred because a request exceeded the default HTTP timeout of {{ timeout }}ms. To increase the default HTTP timeout, run {{ configSetCommand }}."
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.
15181519
suppressErrors:
15191520
platformVersionErrors:
15201521
header: "Platform version update required"

lib/errorHandlers/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ export function logError(error: unknown, context?: ApiErrorContext): void {
4848
const config = getConfig();
4949
const defaultTimeout = config?.httpTimeout;
5050

51+
// Timeout was caused by the default timeout
5152
if (error.timeout && defaultTimeout === error.timeout) {
5253
logger.error(
53-
i18n(`${i18nKey}.timeoutErrorOccurred`, {
54+
i18n(`${i18nKey}.configTimeoutErrorOccurred`, {
5455
timeout: error.timeout,
5556
configSetCommand: uiCommandReference('hs config set'),
5657
})
5758
);
5859
}
60+
// Timeout was caused by a custom timeout set by the CLI or LDL
61+
else {
62+
logger.error(i18n(`${i18nKey}.genericTimeoutErrorOccurred`));
63+
}
5964
}
6065
}
6166

0 commit comments

Comments
 (0)