not-node 4.0.8 → 4.0.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -162,14 +162,18 @@ class notRoute{
162
162
  }
163
163
 
164
164
  async executeRoute(modRoute, actionName, {req, res, next}){
165
- //waiting preparation
166
- let prepared = await this.executeFunction(modRoute, CONST_BEFORE_ACTION, [req, res, next]);
167
- //waiting results
168
- let result = await this.executeFunction(modRoute, actionName, [req, res, next, prepared]);
169
- //filter result IF actionData.return specified
170
- this.filterResultByReturnRule(req, result);
171
- //run after with results, continue without waiting when it finished
172
- return this.executeFunction(modRoute, CONST_AFTER_ACTION, [req, res, next, result]);
165
+ try{
166
+ //waiting preparation
167
+ let prepared = await this.executeFunction(modRoute, CONST_BEFORE_ACTION, [req, res, next]);
168
+ //waiting results
169
+ let result = await this.executeFunction(modRoute, actionName, [req, res, next, prepared]);
170
+ //filter result IF actionData.return specified
171
+ this.filterResultByReturnRule(req, result);
172
+ //run after with results, continue without waiting when it finished
173
+ return this.executeFunction(modRoute, CONST_AFTER_ACTION, [req, res, next, result]);
174
+ }catch(e){
175
+ next(e);
176
+ }
173
177
  }
174
178
 
175
179
  async executeFunction(obj, name, params) {