@akinon/next 2.0.0-beta.18 → 2.0.0-beta.19

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,11 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 2.0.0-beta.19
4
+
5
+ ### Minor Changes
6
+
7
+ - cd68a97a: ZERO-4126: Enhance error handling in appFetch and related data handlers to throw notFound on 404 and 422 errors
8
+
3
9
  ## 2.0.0-beta.18
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "2.0.0-beta.18",
4
+ "version": "2.0.0-beta.19",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "set-cookie-parser": "2.6.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@akinon/eslint-plugin-projectzero": "2.0.0-beta.18",
38
+ "@akinon/eslint-plugin-projectzero": "2.0.0-beta.19",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
@@ -2,6 +2,7 @@ import Settings from 'settings';
2
2
  import logger from '../utils/log';
3
3
  import { headers, cookies } from 'next/headers';
4
4
  import { ServerVariables } from './server-variables';
5
+ import { notFound } from 'next/navigation';
5
6
 
6
7
  export enum FetchResponseType {
7
8
  JSON = 'json',
@@ -75,6 +76,10 @@ const appFetch = async <T>({
75
76
  }
76
77
  }
77
78
 
79
+ if (status === 422) {
80
+ notFound();
81
+ }
82
+
78
83
  return response;
79
84
  };
80
85