@felloh-org/lambda-wrapper 1.0.20 → 1.0.21

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.
@@ -41,7 +41,7 @@ class Index extends _.default {
41
41
  super();
42
42
  this.body = {
43
43
  data: data !== null ? data : {},
44
- errors: {},
44
+ errors: [],
45
45
  meta: {
46
46
  code: code !== null ? code : {},
47
47
  reason: _statusCodes.default[code].reason,
@@ -95,12 +95,12 @@ class Index extends _.default {
95
95
  }
96
96
  /**
97
97
  * Set errors
98
- * @param errors
98
+ * @param error
99
99
  */
100
100
 
101
101
 
102
- setErrors(errors) {
103
- this.body.errors = errors;
102
+ addError(error) {
103
+ this.body.errors.push(error);
104
104
  }
105
105
  /**
106
106
  * Set a meta variable
@@ -258,7 +258,9 @@ class Request extends _dependencyAware.default {
258
258
  } else {
259
259
  Logger.label('request-validation-failed');
260
260
  const validationErrorResponse = new _response.default({}, 422);
261
- validationErrorResponse.setErrors(validation);
261
+ validationErrorResponse.addError({
262
+ request_parameters: validation
263
+ });
262
264
  reject(validationErrorResponse);
263
265
  }
264
266
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {