Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)

})
}
Expand Down