@cripty2001/utils 0.0.214 → 0.0.216

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.
@@ -17,9 +17,14 @@ export declare class ClientServerError extends ClientError {
17
17
  payload: AppserverData;
18
18
  constructor(code: string, message: string, payload?: AppserverData);
19
19
  }
20
+ type ClientValidationErrorError = {
21
+ path: string;
22
+ message: string;
23
+ value: unknown;
24
+ };
20
25
  export declare class ClientValidationError extends ClientError {
21
- errors: unknown;
22
- constructor(errors: unknown);
26
+ readonly errors: ClientValidationErrorError[];
27
+ constructor(errors: ClientValidationErrorError[]);
23
28
  }
24
29
  export declare class Client {
25
30
  private url;
@@ -32,7 +32,12 @@ exports.ClientServerError = ClientServerError;
32
32
  class ClientValidationError extends ClientError {
33
33
  errors;
34
34
  constructor(errors) {
35
- super("Validation Error");
35
+ const first = errors[0] ?? {
36
+ path: "Internal Error",
37
+ message: "",
38
+ value: undefined,
39
+ };
40
+ super(`[Validation Error] ${first.path}: ${first.message}`);
36
41
  this.errors = errors;
37
42
  }
38
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.214",
3
+ "version": "0.0.216",
4
4
  "description": "Internal Set of utils. If you need them use them, otherwise go to the next package ;)",
5
5
  "homepage": "https://github.com/cripty2001/utils#readme",
6
6
  "bugs": {