@holochain/client
Advanced tools
Comparing version 0.16.4 to 0.16.5
@@ -22,5 +22,3 @@ import { RoleName } from "../types.js"; | ||
export type Tagged<T> = { | ||
type: { | ||
[tag: string]: null; | ||
}; | ||
type: string; | ||
data: T; | ||
@@ -27,0 +25,0 @@ }; |
@@ -12,3 +12,3 @@ const ERROR_TYPE = "error"; | ||
const transformedInput = await transform.input(req); | ||
const input = { type: { [tag]: null }, data: transformedInput }; | ||
const input = { type: tag, data: transformedInput }; | ||
const response = await requester(input, timeout); | ||
@@ -37,5 +37,4 @@ const output = transform.output(response.data); | ||
export const catchError = (res) => { | ||
if (ERROR_TYPE in res.type) { | ||
const errorName = Object.keys(res.data.type)[0]; | ||
const error = new HolochainError(errorName, res.data.data); | ||
if (res.type === ERROR_TYPE) { | ||
const error = new HolochainError(res.data.type, res.data.data); | ||
return Promise.reject(error); | ||
@@ -42,0 +41,0 @@ } |
{ | ||
"name": "@holochain/client", | ||
"version": "0.16.4", | ||
"version": "0.16.5", | ||
"description": "A JavaScript client for the Holochain Conductor API", | ||
@@ -5,0 +5,0 @@ "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106741
3432