@holochain/client 0.16.4 → 0.16.5
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/lib/api/common.d.ts +1 -3
- package/lib/api/common.js +3 -4
- package/package.json +1 -1
package/lib/api/common.d.ts
CHANGED
package/lib/api/common.js
CHANGED
|
@@ -9,7 +9,7 @@ export const DEFAULT_TIMEOUT = 60000;
|
|
|
9
9
|
*/
|
|
10
10
|
export const requesterTransformer = (requester, tag, transform = identityTransformer) => async (req, timeout) => {
|
|
11
11
|
const transformedInput = await transform.input(req);
|
|
12
|
-
const input = { type:
|
|
12
|
+
const input = { type: tag, data: transformedInput };
|
|
13
13
|
const response = await requester(input, timeout);
|
|
14
14
|
const output = transform.output(response.data);
|
|
15
15
|
return output;
|
|
@@ -33,9 +33,8 @@ export class HolochainError extends Error {
|
|
|
33
33
|
}
|
|
34
34
|
// this determines the error format of all error responses
|
|
35
35
|
export const catchError = (res) => {
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
const error = new HolochainError(errorName, res.data.data);
|
|
36
|
+
if (res.type === ERROR_TYPE) {
|
|
37
|
+
const error = new HolochainError(res.data.type, res.data.data);
|
|
39
38
|
return Promise.reject(error);
|
|
40
39
|
}
|
|
41
40
|
else {
|
package/package.json
CHANGED