MCPcopy Create free account
hub / github.com/chain/Core / checkForError

Function checkForError

sdk/node/src/api/transactions.js:5–14  ·  view source on GitHub ↗
(resp)

Source from the content-addressed store, hash-verified

3
4// TODO: replace with default handler in requestSingle/requestBatch variants
5function checkForError(resp) {
6 if ('code' in resp) {
7 throw errors.create(
8 errors.types.BAD_REQUEST,
9 errors.formatErrMsg(resp, ''),
10 {body: resp}
11 )
12 }
13 return resp
14}
15
16/**
17 * A blockchain consists of an immutable set of cryptographically linked

Callers 1

transactionsAPIFunction · 0.85

Calls 1

createMethod · 0.65

Tested by

no test coverage detected