Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error not being descriptive #1

Open
tomasdev opened this issue Dec 2, 2014 · 1 comment
Open

Error not being descriptive #1

tomasdev opened this issue Dec 2, 2014 · 1 comment

Comments

@tomasdev
Copy link

tomasdev commented Dec 2, 2014

throw Error(); could be improved with some message for devs, like "I couldn't encode the char XX because of the mapping wasn't found"

I'm getting into that line with codePoint = 8706 and mode not being set (therefore defaulting to fatal) while trying to .encode().

I have no idea how to fix it, buuuut I'd be more than happy to PR otherwise. I've read https://mathiasbynens.be/notes/javascript-encoding but I get lost in // “Return a byte whose value is pointer + 0x80.” anyway :|

Update: I see the list is coming from https://encoding.spec.whatwg.org/index-windows-1252.txt - But my newbie question would be... how does windows-1252 show any character outside that list and above 0x7F ? I remember seeing the character this issue is about (∂) on windows as well.

(Yay first issue here!)

@Prinzhorn
Copy link

Well, almost ten years later this just bit us. We had a bug in our error handling that was causing errors without a message to trigger an endless recursion resulting in a RangeError masking the original error in windows-1252. Even after fixing it the error is still not descriptive, it just says "Error: Error". Luckily the stack pointed to windows-1252 and here I am.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants