@adobe/helix-admin-support 2.4.5 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.5.0](https://github.com/adobe/helix-admin-support/compare/v2.4.5...v2.5.0) (2024-03-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * add status in exception for non-optional fetch ([#237](https://github.com/adobe/helix-admin-support/issues/237)) ([82e2285](https://github.com/adobe/helix-admin-support/commit/82e22852bfbc7945ef0a9fd231165af694fb3474))
7
+
1
8
  ## [2.4.5](https://github.com/adobe/helix-admin-support/compare/v2.4.4...v2.4.5) (2024-03-10)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "2.4.5",
3
+ "version": "2.5.0",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/contentbus.js CHANGED
@@ -71,5 +71,7 @@ export async function getContentBusId(ctx, info, optional) {
71
71
  if (ctx.attributes.contentBusId || optional) {
72
72
  return ctx.attributes.contentBusId;
73
73
  }
74
- throw Error(`unable to load contentbus-id for ${info.owner}/${info.repo}/${info.ref}`);
74
+ const err = new Error(`unable to load contentbus-id for ${info.owner}/${info.repo}/${info.ref}`);
75
+ err.status = 404;
76
+ throw err;
75
77
  }
@@ -88,5 +88,7 @@ export async function fetchFstab(ctx, opts, optional) {
88
88
  return attributes.mountConfig;
89
89
  }
90
90
 
91
- throw Error(`no fstab for ${opts.owner}/${opts.repo}/main/fstab.yaml`);
91
+ const err = new Error(`no fstab for ${opts.owner}/${opts.repo}/main/fstab.yaml`);
92
+ err.status = 404;
93
+ throw err;
92
94
  }
@@ -88,5 +88,7 @@ export async function fetchHelixConfig(ctx, info, optional) {
88
88
  if (attributes.helixConfig || optional) {
89
89
  return attributes.helixConfig;
90
90
  }
91
- throw Error(`no helix-config for ${owner}/${repo}/${ref}`);
91
+ const err = Error(`no helix-config for ${owner}/${repo}/${ref}`);
92
+ err.status = 404;
93
+ throw err;
92
94
  }
@@ -88,5 +88,7 @@ export async function fetchIndex(ctx, opts, optional) {
88
88
  return attributes.indexConfig;
89
89
  }
90
90
 
91
- throw Error(`no index configuration for ${owner}/${repo}/${ref}`);
91
+ const err = new Error(`no index configuration for ${owner}/${repo}/${ref}`);
92
+ err.status = 404;
93
+ throw err;
92
94
  }
@@ -64,5 +64,7 @@ export async function fetchSitemap(ctx, opts, optional) {
64
64
  if (attributes.sitemapConfig || optional) {
65
65
  return attributes.sitemapConfig;
66
66
  }
67
- throw Error(`no sitemap configuration for ${key}`);
67
+ const err = new Error(`no sitemap configuration for ${key}`);
68
+ err.status = 404;
69
+ throw err;
68
70
  }