Uploaded image for project: 'Social Justice Repair Kit'
  1. Social Justice Repair Kit
  2. SJRK-419

Make server log and error messages localized

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None

    Description

      The logging and error messages in the Storytelling Tool server code are currently hardcoded in the functions, which is brittle and difficult to manage. Make the messages configurable externally and localized, such that they are all stored in and managed from the same location.

       

      E.g.

      sjrk.storyTelling.server.saveStoryToDatabase = function (dataSource, storyModel, successEvent, failureEvent) {
          var id = fluid.get(storyModel, "id") || uuidv4();
      
          dataSource.set({directStoryId: id}, storyModel).then(function (response) {
              successEvent.fire(JSON.stringify(response));
          }, function (error) {
              failureEvent.fire({
                  isError: true,
                  message: error.reason || "Unspecified server error saving story to database."
              });
          });
      };
      

       

      would become something like

      sjrk.storyTelling.server.saveStoryToDatabase = function (dataSource, storyModel, successEvent, failureEvent) {
          var id = fluid.get(storyModel, "id") || uuidv4();
      
          dataSource.set({directStoryId: id}, storyModel).then(function (response) {
              successEvent.fire(JSON.stringify(response));
          }, function (error) {
              failureEvent.fire({
                  isError: true,
                  message: error.reason || messages.unspecifiedStorySaveError;
              });
              // NOTE: this example doesn't describe how the message string
              // is accessible to the function
          });
      };
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            gmoss Gregor Moss
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: