chyz 1.0.13-rc.12 → 1.0.13-rc.13

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/base/BaseError.ts CHANGED
@@ -5,12 +5,14 @@
5
5
  * Github:https://github.com/cihan53/
6
6
  */
7
7
 
8
+ import Utils from "../requiments/Utils";
9
+
8
10
  export class BaseError extends Error {
9
11
  private statusCode: number;
10
12
 
11
13
  constructor(message: string,statusCode=500) {
12
14
  super(message);
13
- this.message=message;
15
+ this.message= Utils.isString(message)?message: JSON.stringify(message);
14
16
  this.name = this.constructor.name // good practice
15
17
  this.statusCode = statusCode // error code for responding to client
16
18
  Error.captureStackTrace(this)
@@ -5,12 +5,16 @@
5
5
  * E-mail: cihan@chy.com.tr
6
6
  * Github:https://github.com/cihan53/
7
7
  */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.BaseError = void 0;
13
+ const Utils_1 = __importDefault(require("../requiments/Utils"));
10
14
  class BaseError extends Error {
11
15
  constructor(message, statusCode = 500) {
12
16
  super(message);
13
- this.message = message;
17
+ this.message = Utils_1.default.isString(message) ? message : JSON.stringify(message);
14
18
  this.name = this.constructor.name; // good practice
15
19
  this.statusCode = statusCode; // error code for responding to client
16
20
  Error.captureStackTrace(this);
@@ -1 +1 @@
1
- {"version":3,"file":"BaseError.js","sourceRoot":"","sources":["../../base/BaseError.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,MAAa,SAAU,SAAQ,KAAK;IAGhC,YAAY,OAAe,EAAC,UAAU,GAAC,GAAG;QACtC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAC,OAAO,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA,CAAC,gBAAgB;QAClD,IAAI,CA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CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAC,CAAA;IAC3E,CAAC;CACJ;AAjBD,8BAiBC"}
package/dist/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": " 1.0.13-rc.12",
3
+ "version": " 1.0.13-rc.13",
4
4
  "description": "Nodejs Micro service Framework",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "dev": "nodemon -t --trace-warnings index.ts",
8
8
  "debug": "ts-node index.ts",
9
9
  "build": "rmdir /S /Q .\\dist && npx tsc && xcopy .\\log .\\dist\\log /e /i /h /Y && copy .\\package.json .\\dist\\package.json",
10
- "publish": "npm publish",
11
10
  "test": "echo \"Error: no test specified\" && exit 1",
12
11
  "postversion": "git push && git push --tags"
13
12
  },
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": " 1.0.13-rc.12",
3
+ "version": " 1.0.13-rc.13",
4
4
  "description": "Nodejs Micro service Framework",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "dev": "nodemon -t --trace-warnings index.ts",
8
8
  "debug": "ts-node index.ts",
9
9
  "build": "rmdir /S /Q .\\dist && npx tsc && xcopy .\\log .\\dist\\log /e /i /h /Y && copy .\\package.json .\\dist\\package.json",
10
- "publish": "npm publish",
11
10
  "test": "echo \"Error: no test specified\" && exit 1",
12
11
  "postversion": "git push && git push --tags"
13
12
  },