primate 0.30.0 → 0.30.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/package.json +1 -1
- package/src/hooks/handle.js +2 -2
package/package.json
CHANGED
package/src/hooks/handle.js
CHANGED
|
@@ -20,7 +20,7 @@ const guard = (app, guards) => async (request, next) => {
|
|
|
20
20
|
return next(request);
|
|
21
21
|
} catch (error) {
|
|
22
22
|
if (error.type === guard_error) {
|
|
23
|
-
return
|
|
23
|
+
return { response: respond(error.result)(app) };
|
|
24
24
|
}
|
|
25
25
|
// rethrow if not guard error
|
|
26
26
|
throw error;
|
|
@@ -57,7 +57,7 @@ export default app => {
|
|
|
57
57
|
const routed = await (await cascade(hooks))({ ...request, path });
|
|
58
58
|
|
|
59
59
|
const $layouts = { layouts: await get_layouts(layouts, routed.request) };
|
|
60
|
-
return
|
|
60
|
+
return respond(routed.response)(app, $layouts, routed.request);
|
|
61
61
|
}).orelse(async error => {
|
|
62
62
|
app.log.auto(error);
|
|
63
63
|
|