michielbdejong / ilp-node

Interledger Connector, used for https://github.com/interledger/interledger/wiki/The-Interledger-Testnet-of-Testnets-(IToT)
https://gitter.im/interledger/testnet-of-testnets
0 stars 0 forks source link

error handling #10

Closed michielbdejong closed 6 years ago

michielbdejong commented 6 years ago

Just set an incorrect field in the sendTransfer function in VirtualPeer, and you get ugliness:

sending ILP payment on on-ledger transfer
VirtualPeer calls sendTransfer! { id: '0a8603d7-1c57-4c7f-8590-887834a25ba6',
  from: 'test.crypto.xrp.rhjRdyVNcaTNLXp3rkK4KtjCdUd9YEgrPs',
  to: 'test.crypto.xrp.rB1vPd6fnPZQUHmnxexfzXsUPdKKjfTQxQ',
  ledger: 'test.crypto.xrp.',
  amount: '1',
  ilp: 'AT0AAAAAAAAAATJ0ZXN0LmNyeXB0by54cnAuckIxdlBkNmZuUFpRVUhtbnhleGZ6WHNVUGRLS2pmVFF4UQAA',
  noteToSelf: {},
  executionCondition: 'gZyrZsEvZZbeoetw1B6lcX+6VKO2iraLOBOT9uQkLPc=',
  expiresAt: 2017-08-31T12:47:30.492Z,
  custom: {} }
sendTransfer failed [ValidationError(instance.escrowCreation.allowCancelAfter is not of a type(s) string)]
transfer err  in VirtualPeer { code: 'L62',
  name: 'instance.escrowCreation.allowCancelAfter is not of a type(s) string' } object false
(node:25751) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
(node:25751) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C