@meet-im/lxcli 0.0.10 → 0.0.11
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/dist/commands/services/kb/rpc.js +2 -2
- package/dist/core/error.d.ts +10 -1
- package/dist/core/error.js +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
|
|
|
31
31
|
const response = result.data;
|
|
32
32
|
// JSON-RPC 层错误
|
|
33
33
|
if (response.error) {
|
|
34
|
-
outputCliError('
|
|
34
|
+
outputCliError('API_ERROR', response.error.message, {
|
|
35
35
|
code: response.error.code,
|
|
36
36
|
data: response.error.data,
|
|
37
37
|
requestId,
|
|
@@ -41,7 +41,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
|
|
|
41
41
|
return undefined;
|
|
42
42
|
}
|
|
43
43
|
if (response.result === undefined) {
|
|
44
|
-
outputCliError('
|
|
44
|
+
outputCliError('API_ERROR', 'No result returned from Kanboard API', {
|
|
45
45
|
method,
|
|
46
46
|
params,
|
|
47
47
|
requestId,
|
package/dist/core/error.d.ts
CHANGED
|
@@ -62,8 +62,13 @@ export declare const CLI_ERROR_CODES: {
|
|
|
62
62
|
readonly reason: "networkError";
|
|
63
63
|
readonly exitCode: 5;
|
|
64
64
|
};
|
|
65
|
-
readonly
|
|
65
|
+
readonly API_ERROR: {
|
|
66
66
|
readonly code: 50002;
|
|
67
|
+
readonly reason: "apiError";
|
|
68
|
+
readonly exitCode: 1;
|
|
69
|
+
};
|
|
70
|
+
readonly UPGRADE_CHECK_FAILED: {
|
|
71
|
+
readonly code: 50003;
|
|
67
72
|
readonly reason: "upgradeCheckFailed";
|
|
68
73
|
readonly exitCode: 5;
|
|
69
74
|
};
|
|
@@ -111,6 +116,10 @@ export declare function getErrorMeta(key: CliErrorKey): {
|
|
|
111
116
|
readonly exitCode: 5;
|
|
112
117
|
} | {
|
|
113
118
|
readonly code: 50002;
|
|
119
|
+
readonly reason: "apiError";
|
|
120
|
+
readonly exitCode: 1;
|
|
121
|
+
} | {
|
|
122
|
+
readonly code: 50003;
|
|
114
123
|
readonly reason: "upgradeCheckFailed";
|
|
115
124
|
readonly exitCode: 5;
|
|
116
125
|
};
|
package/dist/core/error.js
CHANGED
|
@@ -23,7 +23,8 @@ export const CLI_ERROR_CODES = {
|
|
|
23
23
|
CONFIG_READ_ERROR: { code: 40001, reason: 'configReadError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
24
24
|
CONFIG_WRITE_ERROR: { code: 40002, reason: 'configWriteError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
25
25
|
NETWORK_ERROR: { code: 50001, reason: 'networkError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
26
|
-
|
|
26
|
+
API_ERROR: { code: 50002, reason: 'apiError', exitCode: CLI_EXIT_CODES.GENERAL },
|
|
27
|
+
UPGRADE_CHECK_FAILED: { code: 50003, reason: 'upgradeCheckFailed', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
27
28
|
};
|
|
28
29
|
export function getErrorMeta(key) {
|
|
29
30
|
return CLI_ERROR_CODES[key];
|
package/dist/index.js
CHANGED