@kalutskii/foundation 0.2.0 → 0.2.1
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/index.js +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -145,6 +145,7 @@ async function safeExecute(fn, onError) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// src/hono/hono.validation.ts
|
|
148
|
+
var FALLBACK_ERROR_MESSAGE = "Failed to read payload";
|
|
148
149
|
var requestReaders = {
|
|
149
150
|
json: async (c) => c.req.json(),
|
|
150
151
|
query: (c) => c.req.query(),
|
|
@@ -157,6 +158,8 @@ async function requirePayload(c, target, schema) {
|
|
|
157
158
|
if (parsedPayload.success)
|
|
158
159
|
return parsedPayload.data;
|
|
159
160
|
throw new HTTPException2(400, { message: parsedPayload.error.message });
|
|
161
|
+
}, () => {
|
|
162
|
+
throw new HTTPException2(400, { message: FALLBACK_ERROR_MESSAGE });
|
|
160
163
|
});
|
|
161
164
|
}
|
|
162
165
|
|