iojs: Detect no start line error as sign error#346
iojs: Detect no start line error as sign error#346stephenplusplus merged 1 commit intogoogleapis:masterfrom ryanseys:iojs
Conversation
|
Actually thinking about this a bit more, any sort of error that occurs with the sign will need to be detected. In Node,
|
|
Sounds like an issue upstream. |
|
I would try to get it fixed upstream first. It seems they're very quick at fixing bugs and shipping new patch releases ;) |
|
Upstream issue. +1 on what Sindre said. |
|
Thanks all! An issue has been filed. |
|
As the issue points out, this is a change present in 0.11 so it's not an upstream issue as far as they (io.js) are concerned but an artifact of using 0.11 for io.js. I've updated this PR to detect the difference in error messages for all PEM errors however still unsure whether this is ideal or desired. |
|
I'm fine with merging... in its current form, I couldn't see this hurting anything. 2 questions though:
|
|
Yeah I can add a comment. I don't think so at least for what we are trying to do. |
|
The error is in the form: |
|
I updated the PR to reflect checking for |
|
Does the |
|
Yeah by the looks of it here there's the possibility of basically anything going wrong. I'm surprised I don't see an "arriving late to your daughter's soccer practice" error in there. |
|
I'm only concerned with using |
|
No problem. For the sake of signing a key, I believe it's always a PEM we On Tuesday, January 20, 2015, Stephen Sawchuk notifications@github.com
|
|
So I just mucked around with the key, replacing random characters and got a bunch of different errors: The most notable being |
|
Based on this, I think we are best to have a catch-all and search for "error:" and in the off-chance that our library doesn't fail but we get "invalid_grant" back, we might want to handle that separately? |
|
It's very possible I'm wrong, but this code handles errors from all of our API requests, doesn't it? As in, if I'm uploading a file or running a query on a dataset, etc. I'm not fully sure all of those upstream API endpoints wouldn't use the phrase |
|
The |
iojs: Detect no start line error as sign error
|
Phew. Sounds good to me! |
|
Aside: Yeah that auth code is pretty mind-busting to understand. Closures be everywhere! 😓 |
|
Hopefully that'll be the last of the iojs bugs HAHAHAHAHAHA.... hahahaha... ha ha ha .... sigh |
|
Haha :'( |
I ran all the tests with
iojsinstead ofnodeand only 1 failed due to a different error occurring when attempting to sign a key. I just added the check here so now all tests pass with iojs.Aside: Not that we want to support iojs (yet) but figured I'd have a little fun with it and see how well supported it is. Actually, the fact that iojs isn't 100% compatible and that this PR is necessary at all may be a bug on their end, not ours. Thoughts?