diff --git a/index.js b/index.js index 8a0d67bc..250ab984 100644 --- a/index.js +++ b/index.js @@ -676,7 +676,19 @@ class KeyringController extends EventEmitter { if (winners && winners.length > 0) { return winners[0][0] } - throw new Error('No keyring found for the requested account.') + + // Adding more info to the error + let errorInfo = 'Error info: ' + if (!address) { + errorInfo += 'The address passed in is invalid/empty; ' + } + if (!candidates || !candidates.length) { + errorInfo += 'There are no keyrings; ' + } + if (!winners || !winners.length) { + errorInfo += 'There are keyrings, but none match the address;' + } + throw new Error(`No keyring found for the requested account. ${errorInfo}`) }) }