Skip to content

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

Description

@helenzhou6

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions