Skip to content

Commit 1c62ae4

Browse files
author
Roy Hui
committed
Minor fix
return rejected promise instead of just throw error
1 parent ee75633 commit 1c62ae4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/logs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
let aliasGetAliasFunctionVersion
5959
// Check if --version is specified
6060
if (this._options.version) {
61-
aliasGetAliasFunctionVersion = Promise.resolve(this._options.version)
61+
aliasGetAliasFunctionVersion = BbPromise.resolve(this._options.version)
6262
} else {
6363
aliasGetAliasFunctionVersion = this.aliasGetAliasLatestFunctionVersionByFunctionName(this._alias, this._lambdaName)
6464
}
@@ -126,8 +126,8 @@ module.exports = {
126126

127127
functionLogsShowLogs(logStreamNames) {
128128
if (logStreamNames.length === 0) {
129-
throw new this.serverless.classes
130-
.Error('No existing streams for the latest version of function alias. If you want to view logs of a specific function version, please use --version to specify');
129+
return BbPromise.reject(throw new this.serverless.classes
130+
.Error('No existing streams for the latest version of function alias. If you want to view logs of a specific function version, please use --version to specify'));
131131
}
132132
const formatLambdaLogEvent = event => {
133133
const msgParam = event.message;

0 commit comments

Comments
 (0)