base-x icon indicating copy to clipboard operation
base-x copied to clipboard

Specify the character failing in the decode error

Open sublimator opened this issue 8 years ago • 6 comments
trafficstars

See: https://github.com/cryptocoinjs/base-x/blob/master/index.js#L81 Suggest something like: The character ${char} is not found in base${base} alphabet: ${alphabet}

May get around to a pull request myself at some point

sublimator avatar Feb 11 '17 08:02 sublimator

I'll take this on eventually, but a PR would be welcome!

dcousens avatar Feb 13 '17 06:02 dcousens

This also will need major bump, right? :)

fanatid avatar Feb 13 '17 07:02 fanatid

@fanatid I suppose so, assuming error messages are being matched exactly.

If we just did:

throw new Error('Non-base' + BASE + ' character')

to

throw new Error('Non-base' + BASE + ' character (' + char + ')')

It might not need a major bump?

dcousens avatar Feb 13 '17 07:02 dcousens

It's a semver world. :( :)

sublimator avatar Feb 13 '17 07:02 sublimator

@sublimator PR? :D

dcousens avatar Mar 19 '17 11:03 dcousens

See the name parameter approach I might take in https://github.com/cryptocoinjs/base-x/pull/42

dcousens avatar Jun 02 '17 04:06 dcousens