@lowdefy/server-dev 0.0.0-experimental-20260829192306 → 0.0.0-experimental-20260829202224
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/package.json +34 -34
- package/package.original.json +34 -34
- package/src/middleware/errorHandler.js +12 -0
- package/src/middleware/errorHandler.test.mjs +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260829202224",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -45,39 +45,39 @@
|
|
|
45
45
|
"@hono/mcp": "0.3.0",
|
|
46
46
|
"@hono/node-server": "2.0.4",
|
|
47
47
|
"@hono/vite-dev-server": "0.26.0",
|
|
48
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/blocks-antd-x": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/blocks-captcha": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/blocks-tiptap": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/connection-mongodb": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/docs-content": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/operators-dayjs": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
75
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
76
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
77
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
78
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
79
|
-
"@lowdefy/plugin-better-auth": "0.0.0-experimental-
|
|
80
|
-
"@lowdefy/websockets-core": "0.0.0-experimental-
|
|
48
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260829202224",
|
|
49
|
+
"@lowdefy/api": "0.0.0-experimental-20260829202224",
|
|
50
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260829202224",
|
|
51
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260829202224",
|
|
52
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260829202224",
|
|
53
|
+
"@lowdefy/blocks-antd-x": "0.0.0-experimental-20260829202224",
|
|
54
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260829202224",
|
|
55
|
+
"@lowdefy/blocks-captcha": "0.0.0-experimental-20260829202224",
|
|
56
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260829202224",
|
|
57
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260829202224",
|
|
58
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260829202224",
|
|
59
|
+
"@lowdefy/blocks-tiptap": "0.0.0-experimental-20260829202224",
|
|
60
|
+
"@lowdefy/build": "0.0.0-experimental-20260829202224",
|
|
61
|
+
"@lowdefy/client": "0.0.0-experimental-20260829202224",
|
|
62
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20260829202224",
|
|
63
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20260829202224",
|
|
64
|
+
"@lowdefy/docs-content": "0.0.0-experimental-20260829202224",
|
|
65
|
+
"@lowdefy/engine": "0.0.0-experimental-20260829202224",
|
|
66
|
+
"@lowdefy/errors": "0.0.0-experimental-20260829202224",
|
|
67
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260829202224",
|
|
68
|
+
"@lowdefy/layout": "0.0.0-experimental-20260829202224",
|
|
69
|
+
"@lowdefy/logger": "0.0.0-experimental-20260829202224",
|
|
70
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260829202224",
|
|
71
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260829202224",
|
|
72
|
+
"@lowdefy/operators-dayjs": "0.0.0-experimental-20260829202224",
|
|
73
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260829202224",
|
|
74
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260829202224",
|
|
75
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260829202224",
|
|
76
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260829202224",
|
|
77
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260829202224",
|
|
78
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260829202224",
|
|
79
|
+
"@lowdefy/plugin-better-auth": "0.0.0-experimental-20260829202224",
|
|
80
|
+
"@lowdefy/websockets-core": "0.0.0-experimental-20260829202224",
|
|
81
81
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
82
82
|
"@tailwindcss/postcss": "4.3.1",
|
|
83
83
|
"@vitejs/plugin-react": "6.0.2",
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/server-dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260829202224",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -51,39 +51,39 @@
|
|
|
51
51
|
"@hono/mcp": "0.3.0",
|
|
52
52
|
"@hono/node-server": "2.0.4",
|
|
53
53
|
"@hono/vite-dev-server": "0.26.0",
|
|
54
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
55
|
-
"@lowdefy/api": "0.0.0-experimental-
|
|
56
|
-
"@lowdefy/block-utils": "0.0.0-experimental-
|
|
57
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
58
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
59
|
-
"@lowdefy/blocks-antd-x": "0.0.0-experimental-
|
|
60
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
61
|
-
"@lowdefy/blocks-captcha": "0.0.0-experimental-
|
|
62
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/blocks-tiptap": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/build": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/client": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/connection-mongodb": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/docs-content": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/engine": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/errors": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/layout": "0.0.0-experimental-
|
|
75
|
-
"@lowdefy/logger": "0.0.0-experimental-
|
|
76
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
77
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
78
|
-
"@lowdefy/operators-dayjs": "0.0.0-experimental-
|
|
79
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
80
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
81
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
82
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
83
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
84
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
85
|
-
"@lowdefy/plugin-better-auth": "0.0.0-experimental-
|
|
86
|
-
"@lowdefy/websockets-core": "0.0.0-experimental-
|
|
54
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260829202224",
|
|
55
|
+
"@lowdefy/api": "0.0.0-experimental-20260829202224",
|
|
56
|
+
"@lowdefy/block-utils": "0.0.0-experimental-20260829202224",
|
|
57
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260829202224",
|
|
58
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260829202224",
|
|
59
|
+
"@lowdefy/blocks-antd-x": "0.0.0-experimental-20260829202224",
|
|
60
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260829202224",
|
|
61
|
+
"@lowdefy/blocks-captcha": "0.0.0-experimental-20260829202224",
|
|
62
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260829202224",
|
|
63
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260829202224",
|
|
64
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260829202224",
|
|
65
|
+
"@lowdefy/blocks-tiptap": "0.0.0-experimental-20260829202224",
|
|
66
|
+
"@lowdefy/build": "0.0.0-experimental-20260829202224",
|
|
67
|
+
"@lowdefy/client": "0.0.0-experimental-20260829202224",
|
|
68
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20260829202224",
|
|
69
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20260829202224",
|
|
70
|
+
"@lowdefy/docs-content": "0.0.0-experimental-20260829202224",
|
|
71
|
+
"@lowdefy/engine": "0.0.0-experimental-20260829202224",
|
|
72
|
+
"@lowdefy/errors": "0.0.0-experimental-20260829202224",
|
|
73
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260829202224",
|
|
74
|
+
"@lowdefy/layout": "0.0.0-experimental-20260829202224",
|
|
75
|
+
"@lowdefy/logger": "0.0.0-experimental-20260829202224",
|
|
76
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260829202224",
|
|
77
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260829202224",
|
|
78
|
+
"@lowdefy/operators-dayjs": "0.0.0-experimental-20260829202224",
|
|
79
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260829202224",
|
|
80
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260829202224",
|
|
81
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260829202224",
|
|
82
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260829202224",
|
|
83
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260829202224",
|
|
84
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260829202224",
|
|
85
|
+
"@lowdefy/plugin-better-auth": "0.0.0-experimental-20260829202224",
|
|
86
|
+
"@lowdefy/websockets-core": "0.0.0-experimental-20260829202224",
|
|
87
87
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
88
88
|
"@tailwindcss/postcss": "4.3.1",
|
|
89
89
|
"@vitejs/plugin-react": "6.0.2",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { redactErrorResponse } from '@lowdefy/api';
|
|
18
|
+
import { HTTPException } from 'hono/http-exception';
|
|
18
19
|
|
|
19
20
|
// Hono routes every handler error to the app-level error handler — upstream
|
|
20
21
|
// middleware try/catch never sees them. API routes get the serialized error
|
|
@@ -55,6 +56,17 @@ function createErrorHandler({ basePath = '', logger }) {
|
|
|
55
56
|
}
|
|
56
57
|
return c.text('Two-factor enrolment required', 403);
|
|
57
58
|
}
|
|
59
|
+
// A route or transport that has already decided its own HTTP answer - hono's
|
|
60
|
+
// HTTPException carries the response to send. The MCP transport refuses an
|
|
61
|
+
// unsupported protocol-version header this way (a 404 with a JSON-RPC body
|
|
62
|
+
// that the client SDK falls back on to negotiate a version both sides
|
|
63
|
+
// know). Not a fault: send its response and log one warning line, no
|
|
64
|
+
// structured error log and no Sentry capture. Turning it into a 500 would
|
|
65
|
+
// hide the status the client acts on.
|
|
66
|
+
if (error instanceof HTTPException) {
|
|
67
|
+
logger.warn(`${error.status} answered by the route: ${c.req.method} ${c.req.path}`);
|
|
68
|
+
return error.getResponse();
|
|
69
|
+
}
|
|
58
70
|
const context = c.get('lowdefyContext');
|
|
59
71
|
if (context) {
|
|
60
72
|
await context.handleError(error);
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { Hono } from 'hono';
|
|
18
|
+
import { HTTPException } from 'hono/http-exception';
|
|
18
19
|
import { jest } from '@jest/globals';
|
|
19
20
|
|
|
20
21
|
import createErrorHandler from './errorHandler.js';
|
|
@@ -205,6 +206,24 @@ test('errorHandler returns text at 403 for a TwoFactorEnrolmentRequiredError on
|
|
|
205
206
|
expect(context.handleError).not.toHaveBeenCalled();
|
|
206
207
|
});
|
|
207
208
|
|
|
209
|
+
test('errorHandler sends an HTTPException response as-is with one warning and no error log', async () => {
|
|
210
|
+
const logger = createLogger();
|
|
211
|
+
const error = new HTTPException(404, {
|
|
212
|
+
res: Response.json(
|
|
213
|
+
{ jsonrpc: '2.0', error: { code: -32000, message: 'Unsupported protocol version' } },
|
|
214
|
+
{ status: 404 }
|
|
215
|
+
),
|
|
216
|
+
});
|
|
217
|
+
const res = await createApp({ error, logger }).request('/api/mcp', { method: 'POST' });
|
|
218
|
+
expect(res.status).toEqual(404);
|
|
219
|
+
expect(await res.json()).toEqual({
|
|
220
|
+
jsonrpc: '2.0',
|
|
221
|
+
error: { code: -32000, message: 'Unsupported protocol version' },
|
|
222
|
+
});
|
|
223
|
+
expect(logger.warn).toHaveBeenCalledWith('404 answered by the route: POST /api/mcp');
|
|
224
|
+
expect(logger.error).not.toHaveBeenCalled();
|
|
225
|
+
});
|
|
226
|
+
|
|
208
227
|
test('errorHandler returns 500 with the serialized error envelope on an api path', async () => {
|
|
209
228
|
const res = await createApp({
|
|
210
229
|
error: createErrorWithCause(),
|