Improve getTransaction() error when tx has not been validated yet

This commit is contained in:
Elliot Lee
2019-10-04 23:56:09 -07:00
parent 14e6bf5ef9
commit 6b572ca862
2 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
export {RippleAPI} from './api' export * from './api'
export { export {
FormattedTransactionType FormattedTransactionType

View File

@@ -30,8 +30,12 @@ function attachTransactionDate(connection: Connection, tx: any
if (!ledgerVersion) { if (!ledgerVersion) {
return new Promise(() => { return new Promise(() => {
throw new errors.NotFoundError( const error = new errors.NotFoundError(
'ledger_index and LedgerSequence not found in tx') 'Transaction has not been validated yet; try again later')
error.data = {
details: '(ledger_index and LedgerSequence not found in tx)'
}
throw error
}) })
} }