when we send an auth message to drupal, there are a bunch of error conditions we could handle up front, before we try to parse the response as json.
404 is the most obvious one - we should check the request headers, and if its not a 200, error out before JSON.parse() and set a more useful error.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | autherrorreporting-1129718-4387912.patch | 521 bytes | LSU_JBob |
Comments
Comment #1
LSU_JBob commentedWhat kind of handling? I'm also getting a ton of 404 errors on the back-end even though I'm getting the desired behavior on the front-end. Should we just swallow 404's? or if 404 do not try and parse as JSON?
Comment #2
Anonymous (not verified) commentedThe latter - on 404, there's no point parsing the JSON, instead we can log a better error.
Comment #3
Anonymous (not verified) commentedfirst commit here:
http://drupalcode.org/project/nodejs.git/commit/6a5d146
leaving open, i think there's more to do.
Comment #4
LSU_JBob commentedI've pulled this down and the error messages I'm getting when trying to hit the auth path are a lot friendlier:
Perhaps spit out a little more info about what the auth path it's trying to use when the error "Backend authentication url not found."?
I'm having this problem with it never being able to find a backend authentication and I'm trying to debug it.
Comment #5
Anonymous (not verified) commentedi pushed up some better debugging info, pull the latest code and let me know how you go.
Comment #6
LSU_JBob commentedThis is great, I'm still not able to authenticate but now I have a nice clean debug message after every unsuccessful attempt:
I really like this, but perhaps we should only show it if backendSettings.debug is true.
I will roll a patch now to wrap your console.log(options) in the same way you do your other error reporting.
Comment #7
LSU_JBob commentedHere it is
Comment #8
Anonymous (not verified) commentedworks for me, slightly modified version of your patch committed here:
http://drupalcode.org/project/nodejs.git/commit/8dc44c6
thanks again.
Comment #9
Anonymous (not verified) commentedoh yeah, it looks like you've got the filesystem path rather than the url path, in case you hadn't already figured that out.
Comment #10
LSU_JBob commentedWhat should I put in for my auth path?
Right now my config is:
"host":"localhost",
"authPath":"/var/www/docroot/nodejs/auth/"
Should authPath be a URL?
Comment #11
LSU_JBob commentedfigured it out! Auth is working for me!
Comment #12
bigsyke commentedhow did you get this working?"
Comment #13
LSU_JBob commentedbigsyke, i had to make sure my auth path was correct, for my sandbox i have [IP address]/drupal7
so my auth path was /drupal7/auth, also double check the format of nodejs.config.js
Comment #14
bigsyke commentedSweet man, got it. Thank you!