@serverless-devs/engine 0.0.1-beta.17 → 0.0.1-beta.18
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/lib/actions/index.js +5 -5
- package/lib/index.js +3 -3
- package/lib/types.d.ts +2 -2
- package/package.json +3 -3
package/lib/actions/index.js
CHANGED
|
@@ -155,7 +155,7 @@ class Actions {
|
|
|
155
155
|
});
|
|
156
156
|
if (useAllowFailure)
|
|
157
157
|
return;
|
|
158
|
-
throw new utils_1.
|
|
158
|
+
throw new utils_1.DevsError(error.message, {
|
|
159
159
|
exitCode: constants_1.EXIT_CODE.RUN,
|
|
160
160
|
prefix: `${this.record.lable} ${hook.hookType}-action failed to [${this.record.command}]:`,
|
|
161
161
|
});
|
|
@@ -168,7 +168,7 @@ class Actions {
|
|
|
168
168
|
});
|
|
169
169
|
if (useAllowFailure)
|
|
170
170
|
return;
|
|
171
|
-
throw new utils_1.
|
|
171
|
+
throw new utils_1.DevsError(`The ${hook.path} directory does not exist.`, {
|
|
172
172
|
exitCode: constants_1.EXIT_CODE.DEVS,
|
|
173
173
|
prefix: `${this.record.lable} ${hook.hookType}-action failed to [${this.record.command}]:`,
|
|
174
174
|
});
|
|
@@ -189,7 +189,7 @@ class Actions {
|
|
|
189
189
|
});
|
|
190
190
|
if (useAllowFailure)
|
|
191
191
|
return;
|
|
192
|
-
throw new utils_1.
|
|
192
|
+
throw new utils_1.DevsError(error.message, {
|
|
193
193
|
exitCode: constants_1.EXIT_CODE.PLUGIN,
|
|
194
194
|
prefix: `${this.record.lable} ${hook.hookType}-action failed to [${this.record.command}]:`,
|
|
195
195
|
});
|
|
@@ -216,7 +216,7 @@ class Actions {
|
|
|
216
216
|
});
|
|
217
217
|
if (useAllowFailure)
|
|
218
218
|
return;
|
|
219
|
-
throw new utils_1.
|
|
219
|
+
throw new utils_1.DevsError(error.message, {
|
|
220
220
|
exitCode: constants_1.EXIT_CODE.COMPONENT,
|
|
221
221
|
prefix: `${this.record.lable} ${hook.hookType}-action failed to [${this.record.command}]:`,
|
|
222
222
|
});
|
|
@@ -229,7 +229,7 @@ class Actions {
|
|
|
229
229
|
if (useAllowFailure)
|
|
230
230
|
return;
|
|
231
231
|
// 方法不存在,此时系统将会认为是未找到组件方法,系统的exit code为100;
|
|
232
|
-
throw new utils_1.
|
|
232
|
+
throw new utils_1.DevsError(`The [${command}] command was not found.`, {
|
|
233
233
|
exitCode: constants_1.EXIT_CODE.DEVS,
|
|
234
234
|
prefix: `${this.record.lable} ${hook.hookType}-action failed to [${this.record.command}]:`,
|
|
235
235
|
tips: `Please check the component ${componentName} has the ${command} command. Serverless Devs documents:${chalk_1.default.underline('https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command')}`,
|
package/lib/index.js
CHANGED
|
@@ -479,7 +479,7 @@ class Engine {
|
|
|
479
479
|
if (useAllowFailure)
|
|
480
480
|
return;
|
|
481
481
|
const error = e;
|
|
482
|
-
throw new utils_2.
|
|
482
|
+
throw new utils_2.DevsError(error.message, {
|
|
483
483
|
exitCode: constants_1.EXIT_CODE.COMPONENT,
|
|
484
484
|
prefix: `[${item.projectName}] failed to [${command}]:`,
|
|
485
485
|
});
|
|
@@ -492,7 +492,7 @@ class Engine {
|
|
|
492
492
|
if (useAllowFailure)
|
|
493
493
|
return;
|
|
494
494
|
// 方法不存在,此时系统将会认为是未找到组件方法,系统的exit code为100;
|
|
495
|
-
throw new utils_2.
|
|
495
|
+
throw new utils_2.DevsError(`The [${command}] command was not found.`, {
|
|
496
496
|
exitCode: constants_1.EXIT_CODE.DEVS,
|
|
497
497
|
tips: `Please check the component ${item.component} has the ${command} command. Serverless Devs documents:${chalk_1.default.underline('https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command')}`,
|
|
498
498
|
prefix: `[${item.projectName}] failed to [${command}]:`,
|
|
@@ -512,7 +512,7 @@ class Engine {
|
|
|
512
512
|
if (useAllowFailure)
|
|
513
513
|
return;
|
|
514
514
|
const error = e;
|
|
515
|
-
throw new utils_2.
|
|
515
|
+
throw new utils_2.DevsError(error.message, {
|
|
516
516
|
exitCode: constants_1.EXIT_CODE.COMPONENT,
|
|
517
517
|
prefix: `[${item.projectName}] failed to [${command}]:`,
|
|
518
518
|
});
|
package/lib/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { IStep } from '@serverless-devs/parse-spec';
|
|
|
3
3
|
import { IOptions as ILogConfig } from '@serverless-devs/logger/lib/type';
|
|
4
4
|
import Logger, { ILoggerInstance } from '@serverless-devs/logger';
|
|
5
5
|
import { AssertionError } from 'assert';
|
|
6
|
-
import {
|
|
6
|
+
import { DevsError } from '@serverless-devs/utils';
|
|
7
7
|
export interface IEngineOptions {
|
|
8
8
|
args?: string[];
|
|
9
9
|
template?: string;
|
|
@@ -70,5 +70,5 @@ export interface IContext {
|
|
|
70
70
|
error: IEngineError[];
|
|
71
71
|
output: Record<string, any>;
|
|
72
72
|
}
|
|
73
|
-
export type IEngineError = Error | AssertionError |
|
|
73
|
+
export type IEngineError = Error | AssertionError | DevsError;
|
|
74
74
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serverless-devs/engine",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.18",
|
|
4
4
|
"description": "request for serverless-devs",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "xsahxl",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"xstate": "^4.37.2",
|
|
21
21
|
"@serverless-devs/credential": "^0.0.2-beta.1",
|
|
22
22
|
"@serverless-devs/load-component": "^0.0.2-beta.3",
|
|
23
|
+
"@serverless-devs/logger": "^0.0.2-beta.6",
|
|
23
24
|
"@serverless-devs/parse-spec": "^0.0.1-beta.9",
|
|
24
|
-
"@serverless-devs/
|
|
25
|
-
"@serverless-devs/utils": "^0.0.8-beta.2"
|
|
25
|
+
"@serverless-devs/utils": "^0.0.8-beta.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/fs-extra": "^11.0.1",
|