@centreon/js-config 25.6.5 → 25.9.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.
@@ -19,6 +19,13 @@ interface Containers {
19
19
  [key: string]: StartedTestContainer;
20
20
  }
21
21
 
22
+ class NotFoundContainerError extends Error {
23
+ constructor(message) {
24
+ super(message);
25
+ this.name = 'NotFoundContainerError';
26
+ }
27
+ }
28
+
22
29
  export default (on: Cypress.PluginEvents): void => {
23
30
  let dockerEnvironment: StartedDockerComposeEnvironment | null = null;
24
31
  const containers: Containers = {};
@@ -31,7 +38,7 @@ export default (on: Cypress.PluginEvents): void => {
31
38
  } else if (containers[containerName]) {
32
39
  container = containers[containerName];
33
40
  } else {
34
- throw new Error(`Cannot get container ${containerName}`);
41
+ throw new NotFoundContainerError(`Cannot get container ${containerName}`);
35
42
  }
36
43
 
37
44
  return container;
@@ -68,7 +75,11 @@ export default (on: Cypress.PluginEvents): void => {
68
75
  });
69
76
  });
70
77
  } catch (error) {
71
- console.error(error);
78
+ if (error instanceof NotFoundContainerError) {
79
+ console.log(`Cannot get ${source} from container ${serviceName} because it doesn't exist.`);
80
+ } else {
81
+ console.error(error);
82
+ }
72
83
  }
73
84
 
74
85
  return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "25.6.5",
4
+ "version": "25.9.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"