-
Notifications
You must be signed in to change notification settings - Fork 19
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
undefined error issue #69
Comments
I guess the only way to properly solve this is to use the following ES6 technique, following this Stack Overflow post: Edit: The sad thing is that it's not supported by Node.JS at the moment. We might want to take a look into Babel's way of translating this feature; so that we can do it on our own in Arsenal, without relying on babel.
I wanna cry :'( |
😞 that hurts. |
I'm completely not against such kind of metaprogramming, and that's the only way I see that would have allowed to keep the current API, while ensuring that using an undefined error name would have used either a "default error" or failed early. That might be my dark metaprogrammer side talking here, but I love simple APIs that are powerful :D |
This is where static analysis is supposed to shine. I'll try to look into that in my free time. |
Indeed, it's yet another track to follow, but still, this means setting up a tool in all projects to ensure that this one is used properly. I'd rather have it self contained with black magic ^^' |
Making sure this issue gets logged so that we don't forget about this. While fixing Vault with pr https://github.com/scality/IronMan-Vault/pull/228
we noticed that if we mess up the case(uppercase/lowercase) of the arsenal error property, we just return
undefined
back to the calling function. Now we don't know if we gotundefined
because there was no error or if the Arsenal error property does not exist.The text was updated successfully, but these errors were encountered: