@edgestore/react 0.1.5-alpha.18 → 0.1.5-alpha.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/dist/index.js CHANGED
@@ -33,14 +33,15 @@ class EdgeStoreClientError extends Error {
33
33
  }
34
34
 
35
35
  async function handleError(res) {
36
+ let json = {};
36
37
  try {
37
- const json = await res.json();
38
- throw new shared.EdgeStoreApiClientError({
39
- response: json
40
- });
38
+ json = await res.json();
41
39
  } catch (err) {
42
40
  throw new EdgeStoreClientError(`Failed to parse response. Make sure the api is correctly configured at ${res.url}`);
43
41
  }
42
+ throw new shared.EdgeStoreApiClientError({
43
+ response: json
44
+ });
44
45
  }
45
46
 
46
47
  function createNextProxy({ apiPath, uploadingCountRef, maxConcurrentUploads = 5 }) {
package/dist/index.mjs CHANGED
@@ -9,14 +9,15 @@ class EdgeStoreClientError extends Error {
9
9
  }
10
10
 
11
11
  async function handleError(res) {
12
+ let json = {};
12
13
  try {
13
- const json = await res.json();
14
- throw new EdgeStoreApiClientError({
15
- response: json
16
- });
14
+ json = await res.json();
17
15
  } catch (err) {
18
16
  throw new EdgeStoreClientError(`Failed to parse response. Make sure the api is correctly configured at ${res.url}`);
19
17
  }
18
+ throw new EdgeStoreApiClientError({
19
+ response: json
20
+ });
20
21
  }
21
22
 
22
23
  function createNextProxy({ apiPath, uploadingCountRef, maxConcurrentUploads = 5 }) {
@@ -1 +1 @@
1
- {"version":3,"file":"handleError.d.ts","sourceRoot":"","sources":["../../../src/libs/errors/handleError.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAS/D"}
1
+ {"version":3,"file":"handleError.d.ts","sourceRoot":"","sources":["../../../src/libs/errors/handleError.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAU/D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgestore/react",
3
- "version": "0.1.5-alpha.18",
3
+ "version": "0.1.5-alpha.19",
4
4
  "description": "Upload files with ease from React/Next.js",
5
5
  "homepage": "https://edgestore.dev",
6
6
  "repository": "https://github.com/edgestorejs/edgestore.git",
@@ -66,14 +66,14 @@
66
66
  "uuid": "^9.0.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@edgestore/shared": "0.1.5-alpha.18",
69
+ "@edgestore/shared": "0.1.5-alpha.19",
70
70
  "next": "*",
71
71
  "react": ">=16.8.0",
72
72
  "react-dom": ">=16.8.0",
73
73
  "zod": ">=3.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@edgestore/shared": "0.1.5-alpha.18",
76
+ "@edgestore/shared": "0.1.5-alpha.19",
77
77
  "@swc/helpers": "0.5.3",
78
78
  "@types/cookie": "^0.5.1",
79
79
  "@types/node": "^18.11.18",
@@ -84,5 +84,5 @@
84
84
  "typescript": "^5.1.6",
85
85
  "zod": "3.21.4"
86
86
  },
87
- "gitHead": "10109dd7d4eadae627e0ebb2078be0c910a2dfae"
87
+ "gitHead": "c26eeb3eb8ae427eaf76cc782fa50f6b293d5651"
88
88
  }
@@ -2,12 +2,13 @@ import { EdgeStoreApiClientError } from '@edgestore/shared';
2
2
  import EdgeStoreClientError from './EdgeStoreClientError';
3
3
 
4
4
  export async function handleError(res: Response): Promise<never> {
5
+ let json: any = {};
5
6
  try {
6
- const json = await res.json();
7
- throw new EdgeStoreApiClientError({ response: json });
7
+ json = await res.json();
8
8
  } catch (err) {
9
9
  throw new EdgeStoreClientError(
10
10
  `Failed to parse response. Make sure the api is correctly configured at ${res.url}`,
11
11
  );
12
12
  }
13
+ throw new EdgeStoreApiClientError({ response: json });
13
14
  }