@dnax/core 0.21.2 → 0.22.0
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/app/hono.ts +4 -4
- package/package.json +1 -1
- package/utils/index.ts +2 -0
package/app/hono.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { asyncLocalStorage, sessionStorage } from "../lib/asyncLocalStorage";
|
|
|
16
16
|
import { localSession } from "../lib/session";
|
|
17
17
|
import {
|
|
18
18
|
cleanPath,
|
|
19
|
-
|
|
19
|
+
ContextError,
|
|
20
20
|
jwt,
|
|
21
21
|
fn,
|
|
22
22
|
omit,
|
|
@@ -258,7 +258,7 @@ function HonoInstance(): typeof app {
|
|
|
258
258
|
try {
|
|
259
259
|
// control tenant
|
|
260
260
|
if (!c.var["tenant-id"] || !getTenant(c.var["tenant-id"])) {
|
|
261
|
-
throw new
|
|
261
|
+
throw new ContextError(`Tenant Id missiong or not found`, 404);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
var response;
|
|
@@ -296,7 +296,7 @@ function HonoInstance(): typeof app {
|
|
|
296
296
|
|
|
297
297
|
// Controlle action
|
|
298
298
|
if (!getAction(action)) {
|
|
299
|
-
throw new
|
|
299
|
+
throw new ContextError(`Action ${action} not found`, 400);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
if (action == "execToolkit") {
|
|
@@ -327,7 +327,7 @@ function HonoInstance(): typeof app {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
if (!getAction(action) || !collection) {
|
|
330
|
-
throw new
|
|
330
|
+
throw new ContextError(`Collection ${collection} not found`, 404);
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
// if action and collection
|
package/package.json
CHANGED
package/utils/index.ts
CHANGED
|
@@ -360,6 +360,7 @@ const password = {
|
|
|
360
360
|
verify: verifyHashPassword,
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
+
const contextError = ContextError;
|
|
363
364
|
export {
|
|
364
365
|
dotJson,
|
|
365
366
|
uuid,
|
|
@@ -379,6 +380,7 @@ export {
|
|
|
379
380
|
freeze, // Lock object properties
|
|
380
381
|
resolvePath,
|
|
381
382
|
isDate, // Check if date
|
|
383
|
+
ContextError,
|
|
382
384
|
contextError,
|
|
383
385
|
jwt, // Jwt utils
|
|
384
386
|
_, // Moment utils
|