Skip to content

Commit 45eff4c

Browse files
committed
fix no log found errors
1 parent d384024 commit 45eff4c

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

packages/cli-lib/lang/en.lyaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ en:
441441
logs:
442442
describe: "Get logs for a function within a project"
443443
errors:
444-
appPathRequired: "You must specify an app path using the --appPath argument."
445444
functionNameRequired: "You must pass a function name to retrieve logs for."
446-
logs: "No logs were found for the function name \"{{ functionName }}\" in the app path \"{{ appPath }}\" within the project \"{{ projectName }}\" in account {{ accountId }}."
445+
noAppFunctionLogs: "No logs were found for the function name \"{{ functionName }}\" in the app path \"{{ appPath }}\" within the project \"{{ projectName }}\" in account {{ accountId }}."
446+
noEndpointLogs: "No logs were found for the function name \"{{ functionName }}\" within the project \"{{ projectName }}\" in account {{ accountId }}."
447447
projectNameRequired: "You must specify a project name using the --projectName argument."
448448
examples:
449449
default: "Get 5 most recent logs for function named \"my-function\" within the app named \"app\" within the project named \"my-project\""

packages/cli/commands/project/logs.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ const { EXIT_CODES } = require('../../lib/enums/exitCodes');
2828
const handleLogsError = (e, accountId, projectName, appPath, functionName) => {
2929
if (e.statusCode === 404) {
3030
logger.error(
31-
i18n(`${i18nKey}.errors.logs`, {
32-
accountId,
33-
appPath,
34-
functionName,
35-
projectName,
36-
})
31+
appPath
32+
? i18n(`${i18nKey}.errors.noAppFunctionLogs`, {
33+
accountId,
34+
appPath,
35+
functionName,
36+
projectName,
37+
})
38+
: i18n(`${i18nKey}.errors.noEndpointLogs`, {
39+
accountId,
40+
functionName,
41+
projectName,
42+
})
3743
);
3844
}
3945
};

0 commit comments

Comments
 (0)