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

Tell the user when there has been a server error #68

Open
helenzhou6 opened this issue Apr 13, 2018 · 0 comments
Open

Tell the user when there has been a server error #68

helenzhou6 opened this issue Apr 13, 2018 · 0 comments

Comments

@helenzhou6
Copy link

helenzhou6 commented Apr 13, 2018

In logic.js

} else {
console.log("XHR error", xhr.status);
}

  • I would change your callback functions (such as setStorage()) to become error first and display it to the user.

In handler.js:

ToVaHayGi/src/handler.js

Lines 148 to 149 in 4b3cf6e

bcrypt.genSalt(10, (err, salt) => {
if (err) console.log(err);

ToVaHayGi/src/handler.js

Lines 39 to 41 in 4b3cf6e

if (err || !decoded) {
// if not logged in
console.log(err);

In addition console.log(error), may I suggest also sending something back to the user (like you have done for some others) e.g.:

      res.writeHead(500, 'Content-Type:text/html');
      res.end('<h1>Sorry, there was a problem on our side<h1>');

Since you'll be using this multiple times, perhaps have it has a function that you re-use (with an argument if you wanted to pass in a custom message).

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

1 participant