Uploaded image for project: 'Atlas Module'
  1. Atlas Module
  2. ATLAS-203

Report server errors to the user

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      In most cases, we are logging server side errors (like this) with the pattern:

      if(!!error){
        console.log(error);
      }
      

      This means, while the failure will be logged, the client isn't always informed of the error. It's possible we might be missing some cases where the code will continue (past the log entry) inappropriately.

      Instead, we should adopt a pattern like this:

      if(!!error){
        console.log(error);
        return res.status(500).send({ message: "A useful message that would allow the client to understand what exactly failed and what they might do to fix it"});
      }
      

        Attachments

          Activity

            People

            Assignee:
            heliostrike Sai Sandeep Mutyala
            Reporter:
            burke Burke Mamlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: