mindee 4.33.0 → 4.33.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v4.33.1 - 2025-10-28
4
+ ### Changes
5
+ * :loud_sound: add error code to v2 exceptions
6
+
7
+
3
8
  ## v4.33.0 - 2025-10-27
4
9
  ### Changes
5
10
  * :sparkles: add more details to V2 errors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindee",
3
- "version": "4.33.0",
3
+ "version": "4.33.1",
4
4
  "description": "Mindee Client Library for Node.js",
5
5
  "main": "src/index.js",
6
6
  "bin": "bin/mindee.js",
@@ -1,4 +1,4 @@
1
- import { ErrorDetails, ErrorResponse } from "../parsing/v2";
1
+ import { ErrorDetails, ErrorResponse, ErrorItem } from "../parsing/v2";
2
2
  /**
3
3
  * Main Mindee Error custom class.
4
4
  */
@@ -25,5 +25,6 @@ export declare class MindeeHttpErrorV2 extends MindeeError implements ErrorDetai
25
25
  detail: string;
26
26
  title: string;
27
27
  code: string;
28
+ errors: ErrorItem[];
28
29
  constructor(error: ErrorResponse);
29
30
  }
@@ -44,11 +44,12 @@ class MindeeApiV2Error extends MindeeError {
44
44
  exports.MindeeApiV2Error = MindeeApiV2Error;
45
45
  class MindeeHttpErrorV2 extends MindeeError {
46
46
  constructor(error) {
47
- super(`HTTP ${error.status} :: ${error.title} - ${error.detail}`);
47
+ super(`HTTP ${error.status} - ${error.title} :: ${error.code} - ${error.detail}`);
48
48
  this.status = error.status;
49
49
  this.detail = error.detail;
50
50
  this.title = error.title;
51
51
  this.code = error.code;
52
+ this.errors = error.errors;
52
53
  this.name = "MindeeHttpErrorV2";
53
54
  }
54
55
  }
@@ -17,6 +17,10 @@ export interface ErrorDetails {
17
17
  * A machine-readable code specific to the occurrence of the problem.
18
18
  */
19
19
  code: string;
20
+ /**
21
+ * A machine-readable code specific to the occurrence of the problem.
22
+ */
23
+ errors: ErrorItem[];
20
24
  }
21
25
  /**
22
26
  * Error response detailing a problem. The format adheres to RFC 9457.
@@ -26,9 +30,6 @@ export declare class ErrorResponse implements ErrorDetails {
26
30
  detail: string;
27
31
  title: string;
28
32
  code: string;
29
- /**
30
- * A machine-readable code specific to the occurrence of the problem.
31
- */
32
33
  errors: ErrorItem[];
33
34
  /**
34
35
  * @param serverResponse JSON response from the server.