-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add "Auth error" status code #1083
Conversation
@jykae Please review since you reported the bug. |
@frenchbread reviewing |
@frenchbread I think this still needs some more.. Committing soon to this PR, and plelase comment what you think. |
@jykae Agree but not sure what else we can add.. Some more status codes? |
@frenchbread what do you think? Not sure what to show on client side when getting 401 |
Put WIP, so we are not merging yet, did not test each if-else statement that it works as intended. |
@jykae We could show different message depending on what status code is received but we are basically checking the status of the host. Do you think we should add custom message output depending on status code? |
@jykae Based on our discussion, I tried showing up the status code within the status panel but all the cases I've tested it returned "0" value so I decided to leave it as it is. |
There seems to be several categories of HTTP status codes. We could show, for instance, red, yellow, or green based on the status code category and display the specific status code message on hover. One idea would be the following:
|
@frenchbread where is the line of code where you are handling the server response? What does the response object contain? |
What are some example cases where you are getting a zero value? What value is zero? |
HTTP.call("GET", "http://domain.com"); The above should return an object with a status code. That should work for non-existing domains as well, since it will throw an error. |
Is there a better JS utility for checking a website? E.g. one that would pass us any relevant errors? |
Also, check where you are trying to use the return value. Meteor methods do not return a value as you might expect from normal funcitons. Method values are returned in a callback funciton, wherein you can set a template reactive variable. |
Lets clean up the |
I was just about to write to check if result exists, and maybe do things on client in callback like @brylie says above. |
Also, we might not need a server method here, since we are not storing the data. |
That's also a good point :) Less code. |
Right, I just tried it, but it has some difficulties about cross-origin requests. |
@frenchbread All right, reviewing :) |
// Init indicator element | ||
const apiStatusIndicator = $('#api-status-indicator'); | ||
|
||
// Init regEx for status codes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, you use regexes for status codes, cool
We would have to generate a help text for each status code, since the response object only contains the number. Lets discuss filing that as an enhancement. |
Added internationalisation. |
Cool. Tested, still works, merging. |
Closes #918
Changes
401
status code check