I'm using the JavaScript SDK in Node and have run into a problem making payments on the testnet. I catch the error but am unable to parse it to get at the result_codes which show as [Object] when I console.log it. How do I see what the result_codes are?
Example from console.log(error):
{ [BadResponseError: Transaction submission failed. Server responded: 400 Bad Request]
name: 'BadResponseError',
message: 'Transaction submission failed. Server responded: 400 Bad Request',
data:
{ type: 'https://stellar.org/horizon-errors/transaction_failed',
title: 'Transaction Failed',
status: 400,
detail: 'The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details. Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html',
extras:
{ envelope_xdr: 'AAAAAIxgJdHRvUjFfPV7yVgiazXSBZWuVJv0eizUPO/GugFMAAAAZAB7Ra0AAAACAAAAAAAAAAEAAAALRmx1dHRlciBBcHAAAAAAAQAAAAAAAAABAAAAAEpsuH8rByJ9lm8GkUTGq1eCLEy4D2fayXD3V95vO5w6AAAAAAAAAAABMS0AAAAAAAAAAAHGugFMAAAAQK1jjtWKT8U6KC7VsuylrU1Qn4pwvAbWdjy1IbiGqDkDXpdQP1fbrezu3nOgAwP8OocRr56GcgikwiT1G41/VgI=',
result_codes: [Object],
result_xdr: 'AAAAAAAAAGT////6AAAAAA==' } } }