@lowdefy/errors 0.0.0-experimental-20260202125814
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/LICENSE +201 -0
- package/dist/ConfigError.js +92 -0
- package/dist/ConfigWarning.js +37 -0
- package/dist/LowdefyError.js +65 -0
- package/dist/PluginError.js +109 -0
- package/dist/ServiceError.js +157 -0
- package/dist/build/ConfigError.js +120 -0
- package/dist/build/ConfigMessage.js +122 -0
- package/dist/build/ConfigWarning.js +104 -0
- package/dist/build/index.js +37 -0
- package/dist/build/resolveConfigLocation.js +63 -0
- package/dist/build/resolveErrorConfigLocation.js +45 -0
- package/dist/client/ConfigError.js +79 -0
- package/dist/client/index.js +30 -0
- package/dist/deserializeError.js +36 -0
- package/dist/index.js +48 -0
- package/dist/server/index.js +30 -0
- package/package.json +54 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ /**
|
|
16
|
+
* @lowdefy/errors - Consistent error handling across build, server, and client.
|
|
17
|
+
*
|
|
18
|
+
* Error Hierarchy:
|
|
19
|
+
*
|
|
20
|
+
* 1. LowdefyError - Internal Lowdefy bugs, unexpected conditions
|
|
21
|
+
* - Thrown: Anywhere inside Lowdefy internals
|
|
22
|
+
* - Caught: Top-level catch in build/server/client
|
|
23
|
+
* - Format: [Lowdefy Error] message + stack trace
|
|
24
|
+
*
|
|
25
|
+
* 2. PluginError - Plugin code failures (operators, actions, blocks, requests)
|
|
26
|
+
* - Thrown: At plugin interface layer (NOT by plugins themselves)
|
|
27
|
+
* - Caught: Depends on context (collected or thrown)
|
|
28
|
+
* - Format: [Plugin Error] message. Received: {...} at location.
|
|
29
|
+
*
|
|
30
|
+
* 3. ServiceError - External service failures (network, timeout, 5xx)
|
|
31
|
+
* - Thrown: At plugin interface layer when external service fails
|
|
32
|
+
* - Caught: Request handlers, connection handlers
|
|
33
|
+
* - Format: [Service Error] message
|
|
34
|
+
*
|
|
35
|
+
* 4. ConfigError - Config validation errors (invalid YAML, schema violations)
|
|
36
|
+
* - Thrown: Build validation, schema checks
|
|
37
|
+
* - Caught: Build orchestrator
|
|
38
|
+
* - Format: source:line\n[Config Error] message
|
|
39
|
+
*
|
|
40
|
+
* 5. ConfigWarning - Config inconsistencies (warning in dev, error in prod)
|
|
41
|
+
* - Not an error class, utility for conditional warning/error
|
|
42
|
+
* - Format: source:line\n[Config Warning] message
|
|
43
|
+
*/ import ConfigError from './ConfigError.js';
|
|
44
|
+
import ConfigWarning from './ConfigWarning.js';
|
|
45
|
+
import LowdefyError from './LowdefyError.js';
|
|
46
|
+
import PluginError from './PluginError.js';
|
|
47
|
+
import ServiceError from './ServiceError.js';
|
|
48
|
+
export { ConfigError, ConfigWarning, LowdefyError, PluginError, ServiceError };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ /**
|
|
16
|
+
* @lowdefy/errors/server - Server-side error classes.
|
|
17
|
+
*
|
|
18
|
+
* Re-exports base error classes for server runtime use.
|
|
19
|
+
* Location resolution is handled by the error logging middleware
|
|
20
|
+
* which has access to refMap.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { ConfigError, PluginError, ServiceError } from '@lowdefy/errors/server';
|
|
24
|
+
*/ import ConfigError from '../ConfigError.js';
|
|
25
|
+
import ConfigWarning from '../ConfigWarning.js';
|
|
26
|
+
import deserializeError from '../deserializeError.js';
|
|
27
|
+
import LowdefyError from '../LowdefyError.js';
|
|
28
|
+
import PluginError from '../PluginError.js';
|
|
29
|
+
import ServiceError from '../ServiceError.js';
|
|
30
|
+
export { ConfigError, ConfigWarning, deserializeError, LowdefyError, PluginError, ServiceError };
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lowdefy/errors",
|
|
3
|
+
"version": "0.0.0-experimental-20260202125814",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Lowdefy error classes for consistent error handling across build, server, and client",
|
|
6
|
+
"homepage": "https://lowdefy.com",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"lowdefy",
|
|
9
|
+
"errors",
|
|
10
|
+
"utils"
|
|
11
|
+
],
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/lowdefy/lowdefy/issues"
|
|
14
|
+
},
|
|
15
|
+
"contributors": [
|
|
16
|
+
{
|
|
17
|
+
"name": "Sam Tolmay",
|
|
18
|
+
"url": "https://github.com/SamTolmay"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "Gerrie van Wyk",
|
|
22
|
+
"url": "https://github.com/Gervwyk"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/lowdefy/lowdefy.git"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./dist/index.js",
|
|
32
|
+
"./client": "./dist/client/index.js",
|
|
33
|
+
"./server": "./dist/server/index.js",
|
|
34
|
+
"./build": "./dist/build/index.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/*"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@jest/globals": "28.1.3",
|
|
41
|
+
"@swc/cli": "0.1.63",
|
|
42
|
+
"@swc/core": "1.3.99",
|
|
43
|
+
"@swc/jest": "0.2.29",
|
|
44
|
+
"jest": "28.1.3"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "swc src --out-dir dist --config-file ../../../.swcrc --delete-dir-on-start",
|
|
51
|
+
"clean": "rm -rf dist",
|
|
52
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests"
|
|
53
|
+
}
|
|
54
|
+
}
|