@duvdu-v1/duvdu 1.0.24 → 1.0.25

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.
@@ -1,7 +1,6 @@
1
1
  import { CustomError } from './custom-error';
2
2
  export declare class DatabaseConnectionError extends CustomError {
3
3
  statusCode: number;
4
- reason: string;
5
4
  constructor(message?: string);
6
5
  serializeError(): {
7
6
  message: string;
@@ -6,13 +6,12 @@ class DatabaseConnectionError extends custom_error_1.CustomError {
6
6
  constructor(message) {
7
7
  super(message || 'Error connecting to database');
8
8
  this.statusCode = 500;
9
- this.reason = 'Error connecting to database';
10
9
  Object.setPrototypeOf(this, DatabaseConnectionError.prototype);
11
10
  }
12
11
  serializeError() {
13
12
  return [
14
13
  {
15
- message: this.reason,
14
+ message: this.message || 'Error connecting to database',
16
15
  },
17
16
  ];
18
17
  }
@@ -9,7 +9,7 @@ class NotFound extends custom_error_1.CustomError {
9
9
  Object.setPrototypeOf(this, NotFound.prototype);
10
10
  }
11
11
  serializeError() {
12
- return [{ message: 'not found error' }];
12
+ return [{ message: this.message || 'not found error' }];
13
13
  }
14
14
  }
15
15
  exports.NotFound = NotFound;
@@ -9,7 +9,7 @@ class UnauthenticatedError extends custom_error_1.CustomError {
9
9
  Object.setPrototypeOf(this, UnauthenticatedError.prototype);
10
10
  }
11
11
  serializeError() {
12
- return [{ message: 'un-authenticated error' }];
12
+ return [{ message: this.message || 'un-authenticated error' }];
13
13
  }
14
14
  }
15
15
  exports.UnauthenticatedError = UnauthenticatedError;
@@ -9,7 +9,7 @@ class UnauthorizedError extends custom_error_1.CustomError {
9
9
  Object.setPrototypeOf(this, UnauthorizedError.prototype);
10
10
  }
11
11
  serializeError() {
12
- return [{ message: 'un-unauthorized error' }];
12
+ return [{ message: this.message || 'un-unauthorized error' }];
13
13
  }
14
14
  }
15
15
  exports.UnauthorizedError = UnauthorizedError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [