@equinor/fusion-framework-module-context 4.0.21 → 4.1.0

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.
@@ -0,0 +1,9 @@
1
+ export declare class FusionContextSearchError extends Error {
2
+ #private;
3
+ get title(): string;
4
+ get description(): string | undefined;
5
+ constructor(details: {
6
+ title: string;
7
+ description?: string;
8
+ }, options?: ErrorOptions);
9
+ }
@@ -1 +1 @@
1
- export declare const version = "4.0.21";
1
+ export declare const version = "4.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-context",
3
- "version": "4.0.21",
3
+ "version": "4.1.0",
4
4
  "description": "",
5
5
  "main": "./dist/esm/index.js",
6
6
  "exports": {
@@ -8,6 +8,10 @@
8
8
  "import": "./dist/esm/index.js",
9
9
  "types": "./dist/types/index.d.ts"
10
10
  },
11
+ "./errors.js": {
12
+ "import": "./dist/esm/errors.js",
13
+ "types": "./dist/types/errors.d.ts"
14
+ },
11
15
  "./package.json": "./package.json",
12
16
  "./utils": {
13
17
  "import": "./dist/esm/utils/index.js",
@@ -22,6 +26,9 @@
22
26
  ],
23
27
  "utils": [
24
28
  "dist/types/utils/index.d.ts"
29
+ ],
30
+ "./errors.js": [
31
+ ".dist/types/errors.d.ts"
25
32
  ]
26
33
  }
27
34
  },
@@ -44,8 +51,8 @@
44
51
  "rxjs": "^7.8.1",
45
52
  "typescript": "^5.1.3",
46
53
  "@equinor/fusion-framework-module": "^4.2.7",
47
- "@equinor/fusion-framework-module-event": "^4.0.8",
48
54
  "@equinor/fusion-framework-module-navigation": "^3.1.4",
55
+ "@equinor/fusion-framework-module-event": "^4.0.8",
49
56
  "@equinor/fusion-framework-module-services": "^3.2.4"
50
57
  },
51
58
  "peerDependencies": {
@@ -406,7 +406,15 @@ export class ContextProvider implements IContextProvider {
406
406
  /* @ts-ignore */
407
407
  this.#contextParameterFn({ search, type: this.#contextType }),
408
408
  )
409
- .pipe(map((x) => x.value));
409
+ .pipe(
410
+ catchError((err) => {
411
+ if (err.name === 'QueryClientError') {
412
+ throw err.cause;
413
+ }
414
+ throw err;
415
+ }),
416
+ map((x) => x.value),
417
+ );
410
418
 
411
419
  return this.#contextFilter ? query$.pipe(map(this.#contextFilter)) : query$;
412
420
  }
package/src/errors.ts ADDED
@@ -0,0 +1,23 @@
1
+ export class FusionContextSearchError extends Error {
2
+ #details;
3
+
4
+ get title(): string {
5
+ return this.#details.title;
6
+ }
7
+
8
+ get description(): string | undefined {
9
+ return this.#details.description;
10
+ }
11
+
12
+ constructor(
13
+ details: {
14
+ title: string;
15
+ description?: string;
16
+ },
17
+ options?: ErrorOptions,
18
+ ) {
19
+ super(details.description ?? details.title, options);
20
+ this.#details = details;
21
+ this.name = 'FusionContextSearchError';
22
+ }
23
+ }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '4.0.21';
2
+ export const version = '4.1.0';